public class EncryptionUtil extends Object
| Constructor and Description |
|---|
EncryptionUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
decrypt(EncryptionKey key,
byte[] cipherData,
KeyUsage usage) |
static byte[] |
encrypt(EncryptionKey key,
byte[] plaintext,
KeyUsage usage) |
static List<EncryptionKey> |
generateKeys(List<EncryptionType> encryptionTypes) |
static List<EncryptionKey> |
generateKeys(String principal,
String passwd,
List<EncryptionType> encryptionTypes) |
static String |
getAlgoNameFromEncType(EncryptionType encType) |
static EncryptionType |
getBestEncryptionType(List<EncryptionType> requestedTypes,
List<EncryptionType> configuredTypes) |
static List<EncryptionType> |
orderEtypesByStrength(List<EncryptionType> etypes)
Order a list of EncryptionType in a decreasing strength order
|
static EncryptedData |
seal(org.apache.kerby.asn1.type.Asn1Encodeable asn1Type,
EncryptionKey key,
KeyUsage usage) |
static <T extends org.apache.kerby.asn1.type.Asn1Type> |
unseal(EncryptedData encrypted,
EncryptionKey key,
KeyUsage usage,
Class<T> krbType) |
public static String getAlgoNameFromEncType(EncryptionType encType)
public static List<EncryptionType> orderEtypesByStrength(List<EncryptionType> etypes)
etypes - The ETypes to orderpublic static List<EncryptionKey> generateKeys(List<EncryptionType> encryptionTypes) throws KrbException
KrbExceptionpublic static List<EncryptionKey> generateKeys(String principal, String passwd, List<EncryptionType> encryptionTypes) throws KrbException
KrbExceptionpublic static EncryptionType getBestEncryptionType(List<EncryptionType> requestedTypes, List<EncryptionType> configuredTypes)
public static EncryptedData seal(org.apache.kerby.asn1.type.Asn1Encodeable asn1Type, EncryptionKey key, KeyUsage usage) throws KrbException
KrbExceptionpublic static <T extends org.apache.kerby.asn1.type.Asn1Type> T unseal(EncryptedData encrypted, EncryptionKey key, KeyUsage usage, Class<T> krbType) throws KrbException
KrbExceptionpublic static byte[] encrypt(EncryptionKey key, byte[] plaintext, KeyUsage usage) throws KrbException
KrbExceptionpublic static byte[] decrypt(EncryptionKey key, byte[] cipherData, KeyUsage usage) throws KrbException
KrbExceptionCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.