public class EncryptionHandler extends Object
| Constructor and Description |
|---|
EncryptionHandler() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(byte[] data,
EncryptionKey key,
KeyUsage usage)
Decrypt with the encryption key and key usage.
|
static byte[] |
decrypt(EncryptedData data,
EncryptionKey key,
KeyUsage usage)
Decrypt with the encryption key and key usage.
|
static EncryptedData |
encrypt(byte[] plainText,
EncryptionKey key,
KeyUsage usage)
Encrypt with the encryption key and key usage.
|
static EncTypeHandler |
getEncHandler(EncryptionType eType)
Get the encryption handler.
|
static EncTypeHandler |
getEncHandler(int eType)
Get the encryption handler.
|
static EncTypeHandler |
getEncHandler(String eType)
Get the encryption handler.
|
static EncryptionType |
getEncryptionType(String eType)
Get the encryption type.
|
static boolean |
isImplemented(EncryptionType eType)
Return true if the the encryption handler is implemented.
|
static EncryptionKey |
makeSubkey(EncryptionKey encKey)
Generate a secure and random key seeded with an existing encryption key.
|
static EncryptionKey |
random2Key(EncryptionType eType)
Random to key.
|
static EncryptionKey |
random2Key(EncryptionType eType,
byte[] randomBytes)
Random to key.
|
static EncryptionKey |
string2Key(String string,
String salt,
byte[] s2kparams,
EncryptionType eType)
String to key.
|
static EncryptionKey |
string2Key(String principalName,
String passPhrase,
EncryptionType eType)
String to key.
|
public static EncryptionType getEncryptionType(String eType) throws KrbException
eType - The encryption type string.KrbException - epublic static EncTypeHandler getEncHandler(String eType) throws KrbException
eType - The encryption type stringKrbException - epublic static EncTypeHandler getEncHandler(int eType) throws KrbException
eType - The encryption type intKrbException - epublic static EncTypeHandler getEncHandler(EncryptionType eType) throws KrbException
eType - The encryption typeKrbException - epublic static EncryptedData encrypt(byte[] plainText, EncryptionKey key, KeyUsage usage) throws KrbException
plainText - The plain testkey - The encryption keyusage - The key usageKrbException - epublic static byte[] decrypt(byte[] data,
EncryptionKey key,
KeyUsage usage)
throws KrbException
data - The encrypted datakey - The encryption keyusage - The key usageKrbException - epublic static byte[] decrypt(EncryptedData data, EncryptionKey key, KeyUsage usage) throws KrbException
data - The encrypted datakey - The encryption keyusage - The key usageKrbException - epublic static boolean isImplemented(EncryptionType eType)
eType - The encryption typepublic static EncryptionKey string2Key(String principalName, String passPhrase, EncryptionType eType) throws KrbException
principalName - The principal namepassPhrase - The pass phraseeType - The encryption typeKrbException - epublic static EncryptionKey string2Key(String string, String salt, byte[] s2kparams, EncryptionType eType) throws KrbException
string - The stringsalt - The salts2kparams - The paramseType - The encryption typeKrbException - epublic static EncryptionKey random2Key(EncryptionType eType) throws KrbException
eType - The encryption typeKrbException - epublic static EncryptionKey random2Key(EncryptionType eType, byte[] randomBytes) throws KrbException
eType - The encryption typerandomBytes - The random bytesKrbException - epublic static EncryptionKey makeSubkey(EncryptionKey encKey)
encKey - The encryption keyCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.