public String generateSharedAccessSignature ( SharedAccessAccountPolicy policy ) throws InvalidKeyException , StorageException { if ( ! StorageCredentialsHelper . canCredentialsSignRequest ( this . getCredentials ( ) ) ) { throw new IllegalArgumentException ( SR . CANNOT_CREATE_SAS_WITHOUT_ACCOUNT_KEY ) ; } final String sig = SharedAccessSignatureHelper . generateSharedAccessSignatureHashForAccount ( this . credentials . getAccountName ( ) , policy , this . getCredentials ( ) ) ; final UriQueryBuilder sasBuilder = SharedAccessSignatureHelper . generateSharedAccessSignatureForAccount ( policy , sig ) ; return sasBuilder . toString ( ) ; }
Returns a shared access signature for the account .