|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsun.security.mule.krb5.internal.crypto.dk.DkCrypto
sun.security.mule.krb5.internal.crypto.dk.AesDkCrypto
public class AesDkCrypto
This class provides the implementation of AES Encryption for Kerberos as defined RFC 3962. http://www.ietf.org/rfc/rfc3962.txt Algorithm profile described in [KCRYPTO]: +--------------------------------------------------------------------+ | protocol key format 128- or 256-bit string | | | | string-to-key function PBKDF2+DK with variable | | iteration count (see | | above) | | | | default string-to-key parameters 00 00 10 00 | | | | key-generation seed length key size | | | | random-to-key function identity function | | | | hash function, H SHA-1 | | | | HMAC output size, h 12 octets (96 bits) | | | | message block size, m 1 octet | | | | encryption/decryption functions, AES in CBC-CTS mode | | E and D (cipher block size 16 | | octets), with next to | | last block as CBC-style | | ivec | +--------------------------------------------------------------------+ Supports AES128 and AES256
| Constructor Summary | |
|---|---|
AesDkCrypto(int length)
|
|
| Method Summary | |
|---|---|
byte[] |
calculateChecksum(byte[] baseKey,
int usage,
byte[] input,
int start,
int len)
Calculate the checksum |
byte[] |
decrypt(byte[] baseKey,
int usage,
byte[] ivec,
byte[] ciphertext,
int start,
int len)
|
byte[] |
decryptRaw(byte[] baseKey,
int usage,
byte[] ivec,
byte[] ciphertext,
int start,
int len)
Decrypts data using specified key and initial vector. |
byte[] |
encrypt(byte[] baseKey,
int usage,
byte[] ivec,
byte[] new_ivec,
byte[] plaintext,
int start,
int len)
Performs encryption using derived key; adds confounder. |
byte[] |
encryptRaw(byte[] baseKey,
int usage,
byte[] ivec,
byte[] plaintext,
int start,
int len)
Performs encryption using derived key; does not add confounder. |
int |
getChecksumLength()
|
protected Cipher |
getCipher(byte[] key,
byte[] ivec,
int mode)
|
protected byte[] |
getHmac(byte[] key,
byte[] msg)
Get the truncated HMAC |
protected int |
getKeySeedLength()
|
protected byte[] |
randomToKey(byte[] in)
|
static int |
readBigEndian(byte[] data,
int pos,
int size)
|
byte[] |
stringToKey(char[] password,
String salt,
byte[] s2kparams)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AesDkCrypto(int length)
| Method Detail |
|---|
protected int getKeySeedLength()
getKeySeedLength in class DkCrypto
public byte[] stringToKey(char[] password,
String salt,
byte[] s2kparams)
throws GeneralSecurityException
GeneralSecurityExceptionprotected byte[] randomToKey(byte[] in)
randomToKey in class DkCrypto
protected Cipher getCipher(byte[] key,
byte[] ivec,
int mode)
throws GeneralSecurityException
getCipher in class DkCryptoGeneralSecurityExceptionpublic int getChecksumLength()
getChecksumLength in class DkCrypto
protected byte[] getHmac(byte[] key,
byte[] msg)
throws GeneralSecurityException
getHmac in class DkCryptoGeneralSecurityException
public byte[] calculateChecksum(byte[] baseKey,
int usage,
byte[] input,
int start,
int len)
throws GeneralSecurityException
calculateChecksum in class DkCryptoGeneralSecurityException
public byte[] encrypt(byte[] baseKey,
int usage,
byte[] ivec,
byte[] new_ivec,
byte[] plaintext,
int start,
int len)
throws GeneralSecurityException,
KrbCryptoException
encrypt in class DkCryptoivec - initial vector to use when initializing the cipher; if null,
then blocksize number of zeros are used,new_ivec - if non-null, it is updated upon return to be the
new ivec to use when calling encrypt next time
GeneralSecurityException
KrbCryptoException
public byte[] encryptRaw(byte[] baseKey,
int usage,
byte[] ivec,
byte[] plaintext,
int start,
int len)
throws GeneralSecurityException,
KrbCryptoException
encryptRaw in class DkCryptoGeneralSecurityException
KrbCryptoException
public byte[] decrypt(byte[] baseKey,
int usage,
byte[] ivec,
byte[] ciphertext,
int start,
int len)
throws GeneralSecurityException
decrypt in class DkCryptobaseKey - key from which keys are to be derived using usageciphertext - E(Ke, conf | plaintext | padding, ivec) | H1[1..h]
GeneralSecurityException
public byte[] decryptRaw(byte[] baseKey,
int usage,
byte[] ivec,
byte[] ciphertext,
int start,
int len)
throws GeneralSecurityException
decryptRaw in class DkCryptobaseKey - encryption key to useciphertext - encrypted data to be decryptedusage - ignored
GeneralSecurityException
public static final int readBigEndian(byte[] data,
int pos,
int size)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||