@InterfaceAudience.Private @InterfaceStability.Evolving public class EncryptionUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
private static SecureRandom |
RNG |
| Constructor and Description |
|---|
EncryptionUtil() |
| Modifier and Type | Method and Description |
|---|---|
private static Key |
getUnwrapKey(org.apache.hadoop.conf.Configuration conf,
String subject,
org.apache.hadoop.hbase.protobuf.generated.EncryptionProtos.WrappedKey wrappedKey,
Cipher cipher) |
static Key |
unwrapKey(org.apache.hadoop.conf.Configuration conf,
String subject,
byte[] value)
Unwrap a key by decrypting it with the secret key of the given subject.
|
static Key |
unwrapWALKey(org.apache.hadoop.conf.Configuration conf,
String subject,
byte[] value)
Unwrap a wal key by decrypting it with the secret key of the given subject.
|
static byte[] |
wrapKey(org.apache.hadoop.conf.Configuration conf,
byte[] key,
String algorithm)
Protect a key by encrypting it with the secret key of the given subject.
|
static byte[] |
wrapKey(org.apache.hadoop.conf.Configuration conf,
String subject,
Key key)
Protect a key by encrypting it with the secret key of the given subject.
|
private static final SecureRandom RNG
public static byte[] wrapKey(org.apache.hadoop.conf.Configuration conf,
byte[] key,
String algorithm)
throws IOException
conf - configurationkey - the raw key bytesalgorithm - the algorithm to use with this key materialIOExceptionpublic static byte[] wrapKey(org.apache.hadoop.conf.Configuration conf,
String subject,
Key key)
throws IOException
conf - configurationsubject - subject key aliaskey - the keyIOExceptionpublic static Key unwrapKey(org.apache.hadoop.conf.Configuration conf, String subject, byte[] value) throws IOException, KeyException
conf - configurationsubject - subject key aliasvalue - the encrypted key bytesIOExceptionKeyExceptionprivate static Key getUnwrapKey(org.apache.hadoop.conf.Configuration conf, String subject, org.apache.hadoop.hbase.protobuf.generated.EncryptionProtos.WrappedKey wrappedKey, Cipher cipher) throws IOException, KeyException
IOExceptionKeyExceptionpublic static Key unwrapWALKey(org.apache.hadoop.conf.Configuration conf, String subject, byte[] value) throws IOException, KeyException
conf - configurationsubject - subject key aliasvalue - the encrypted key bytesIOException - if key is not found for the subject, or if some I/O error occursKeyException - if fail to unwrap the keyCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.