@InterfaceAudience.Private @InterfaceStability.Evolving public class EncryptionUtil extends java.lang.Object
| Constructor and Description |
|---|
EncryptionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.security.Key |
unwrapKey(Configuration conf,
java.lang.String subject,
byte[] value)
Unwrap a key by decrypting it with the secret key of the given subject.
|
static java.security.Key |
unwrapWALKey(Configuration conf,
java.lang.String subject,
byte[] value)
Unwrap a wal key by decrypting it with the secret key of the given subject.
|
static byte[] |
wrapKey(Configuration conf,
byte[] key,
java.lang.String algorithm)
Protect a key by encrypting it with the secret key of the given subject.
|
static byte[] |
wrapKey(Configuration conf,
java.lang.String subject,
java.security.Key key)
Protect a key by encrypting it with the secret key of the given subject.
|
public static byte[] wrapKey(Configuration conf,
byte[] key,
java.lang.String algorithm)
throws java.io.IOException
conf - configurationkey - the raw key bytesalgorithm - the algorithm to use with this key materialjava.io.IOExceptionpublic static byte[] wrapKey(Configuration conf,
java.lang.String subject,
java.security.Key key)
throws java.io.IOException
conf - configurationsubject - subject key aliaskey - the keyjava.io.IOExceptionpublic static java.security.Key unwrapKey(Configuration conf,
java.lang.String subject,
byte[] value)
throws java.io.IOException,
java.security.KeyException
conf - configurationsubject - subject key aliasvalue - the encrypted key bytesjava.io.IOExceptionjava.security.KeyExceptionpublic static java.security.Key unwrapWALKey(Configuration conf,
java.lang.String subject,
byte[] value)
throws java.io.IOException,
java.security.KeyException
conf - configurationsubject - subject key aliasvalue - the encrypted key bytesjava.io.IOException - if key is not found for the subject, or if some I/O error occursjava.security.KeyException - if fail to unwrap the key