private ContentCryptoMaterial contentCryptoMaterialOf ( S3ObjectWrapper s3w ) { // Check if encryption info is in object metadata if ( s3w . hasEncryptionInfo ( ) ) { return ContentCryptoMaterial . fromObjectMetadata ( s3w . getObjectMetadata ( ) , kekMaterialsProvider , cryptoConfig . getCryptoProvider ( ) , cryptoConfig . getAlwaysUseCryptoProvider ( ) , false , // existing CEK not necessarily key-wrapped kms ) ; } S3ObjectWrapper orig_ifile = fetchInstructionFile ( s3w . getS3ObjectId ( ) , null ) ; if ( orig_ifile == null ) { throw new IllegalArgumentException ( "S3 object is not encrypted: " + s3w ) ; } String json = orig_ifile . toJsonString ( ) ; return ccmFromJson ( json ) ; }
Returns the content crypto material of an existing S3 object .