Class EncryptionSecrets
java.lang.Object
org.apache.hadoop.fs.s3a.auth.delegation.EncryptionSecrets
- All Implemented Interfaces:
Serializable,org.apache.hadoop.io.Writable
public class EncryptionSecrets
extends Object
implements org.apache.hadoop.io.Writable, Serializable
Encryption options in a form which can serialized or marshalled as a hadoop
Writeable.
Maintainers: For security reasons, don't print any of this.
Note this design marshalls/unmarshalls its serialVersionUID
in its writable, which is used to compare versions.
Important.
If the wire format is ever changed incompatibly,
update the serial version UID to ensure that older clients get safely
rejected.
Important
Do not import any AWS SDK classes, directly or indirectly.
This is to ensure that S3A Token identifiers can be unmarshalled even
without that SDK.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor, for use in marshalling.EncryptionSecrets(String encryptionAlgorithm, String encryptionKey, String encryptionContext) Create a pair of secrets.EncryptionSecrets(S3AEncryptionMethods encryptionAlgorithm, String encryptionKey, String encryptionContext) Create a pair of secrets. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the encryption method.booleanDoes this instance have encryption options?booleanDoes this instance have an encryption context?booleanDoes this instance have an encryption key?inthashCode()voidreadFields(DataInput in) Read in from the writable stream.toString()String function returns the encryption mode but not any other secrets.voidwrite(DataOutput out) Write out the encryption secrets.
-
Field Details
-
MAX_SECRET_LENGTH
public static final int MAX_SECRET_LENGTH- See Also:
-
-
Constructor Details
-
EncryptionSecrets
public EncryptionSecrets()Empty constructor, for use in marshalling. -
EncryptionSecrets
public EncryptionSecrets(S3AEncryptionMethods encryptionAlgorithm, String encryptionKey, String encryptionContext) throws IOException Create a pair of secrets.- Parameters:
encryptionAlgorithm- algorithm enumeration.encryptionKey- key/key reference.encryptionContext- base64-encoded string with the encryption context key-value pairs.- Throws:
IOException- failure to initialize.
-
EncryptionSecrets
public EncryptionSecrets(String encryptionAlgorithm, String encryptionKey, String encryptionContext) throws IOException Create a pair of secrets.- Parameters:
encryptionAlgorithm- algorithm nameencryptionKey- key/key reference.encryptionContext- base64-encoded string with the encryption context key-value pairs.- Throws:
IOException- failure to initialize.
-
-
Method Details
-
write
Write out the encryption secrets.- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Parameters:
out-DataOutputto serialize this object into.- Throws:
IOException- IO failure
-
readFields
Read in from the writable stream. After reading, callinit().- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Parameters:
in-DataInputto deserialize this object from.- Throws:
IOException- failure to read/validate data.
-
getEncryptionAlgorithm
-
getEncryptionKey
-
getEncryptionContext
-
hasEncryptionAlgorithm
public boolean hasEncryptionAlgorithm()Does this instance have encryption options? That is: is the algorithm non-null.- Returns:
- true if there's an encryption algorithm.
-
hasEncryptionKey
public boolean hasEncryptionKey()Does this instance have an encryption key?- Returns:
- true if there's an encryption key.
-
hasEncryptionContext
public boolean hasEncryptionContext()Does this instance have an encryption context?- Returns:
- true if there's an encryption context.
-
equals
-
hashCode
public int hashCode() -
getEncryptionMethod
Get the encryption method.- Returns:
- the encryption method
-
toString
String function returns the encryption mode but not any other secrets.
-