public static String generateSharedAccessSignatureHashForBlobAndFile ( final SharedAccessPolicy policy , SharedAccessHeaders headers , final String accessPolicyIdentifier , final String resourceName , final IPRange ipRange , final SharedAccessProtocols protocols , final ServiceClient client ) throws InvalidKeyException , StorageException { String stringToSign = generateSharedAccessSignatureStringToSign ( policy , resourceName , ipRange , protocols , accessPolicyIdentifier ) ; String cacheControl = null ; String contentDisposition = null ; String contentEncoding = null ; String contentLanguage = null ; String contentType = null ; if ( headers != null ) { cacheControl = headers . getCacheControl ( ) ; contentDisposition = headers . getContentDisposition ( ) ; contentEncoding = headers . getContentEncoding ( ) ; contentLanguage = headers . getContentLanguage ( ) ; contentType = headers . getContentType ( ) ; } stringToSign = String . format ( "%s\n%s\n%s\n%s\n%s\n%s" , stringToSign , cacheControl == null ? Constants . EMPTY_STRING : cacheControl , contentDisposition == null ? Constants . EMPTY_STRING : contentDisposition , contentEncoding == null ? Constants . EMPTY_STRING : contentEncoding , contentLanguage == null ? Constants . EMPTY_STRING : contentLanguage , contentType == null ? Constants . EMPTY_STRING : contentType ) ; return generateSharedAccessSignatureHashHelper ( stringToSign , client . getCredentials ( ) ) ; }
Get the signature hash embedded inside the Shared Access Signature for the blob or file service .