Package org.apache.hadoop.fs.s3a.impl
Class S3AEncryption
java.lang.Object
org.apache.hadoop.fs.s3a.impl.S3AEncryption
Utility methods for S3A encryption properties.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetS3EncryptionContext(String bucket, org.apache.hadoop.conf.Configuration conf) Get any SSE context from a configuration/credential provider.static StringgetS3EncryptionContextBase64Encoded(String bucket, org.apache.hadoop.conf.Configuration conf, boolean propagateExceptions) Get any SSE context from a configuration/credential provider.
-
Method Details
-
getS3EncryptionContext
public static String getS3EncryptionContext(String bucket, org.apache.hadoop.conf.Configuration conf) throws IOException Get any SSE context from a configuration/credential provider.- Parameters:
bucket- bucket to query forconf- configuration to examine- Returns:
- the encryption context value or ""
- Throws:
IOException- if reading a JCEKS file raised an IOEIllegalArgumentException- bad arguments.
-
getS3EncryptionContextBase64Encoded
public static String getS3EncryptionContextBase64Encoded(String bucket, org.apache.hadoop.conf.Configuration conf, boolean propagateExceptions) throws IOException Get any SSE context from a configuration/credential provider. This includes converting the values to a base64-encoded UTF-8 string holding JSON with the encryption context key-value pairs- Parameters:
bucket- bucket to query forconf- configuration to examinepropagateExceptions- should IO exceptions be rethrown?- Returns:
- the Base64 encryption context or ""
- Throws:
IllegalArgumentException- bad arguments.IOException- if propagateExceptions==true and reading a JCEKS file raised an IOE
-