#NEWLINE# def _s3EncryptionHeaders( self ) : #NEWLINE# #INDENT# sseKeyPath = self . outer . sseKeyPath #NEWLINE# if self . encrypted : #NEWLINE# #INDENT# if ( sseKeyPath is None ) : #NEWLINE# #INDENT# raise AssertionError ( 'Content is encrypted but no key was provided.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# with open ( sseKeyPath ) as f : #NEWLINE# #INDENT# sseKey = f . read ( ) #NEWLINE# #UNINDENT# assert ( len ( sseKey ) == 32 ) #NEWLINE# encodedSseKey = base64 . b64encode ( sseKey ) #NEWLINE# encodedSseKeyMd5 = base64 . b64encode ( hashlib . md5 ( sseKey ) . digest ( ) ) #NEWLINE# return { #NEWLINE# #INDENT# 'x-amz-server-side-encryption-customer-algorithm' : 'AES256' , #NEWLINE# 'x-amz-server-side-encryption-customer-key' : encodedSseKey , #NEWLINE# 'x-amz-server-side-encryption-customer-key-md5' : encodedSseKeyMd5 , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# }