| java.lang.Object sun.security.krb5.internal.crypto.dk.DkCrypto
All known Subclasses: sun.security.krb5.internal.crypto.dk.ArcFourCrypto, sun.security.krb5.internal.crypto.dk.AesDkCrypto, sun.security.krb5.internal.crypto.dk.Des3DkCrypto,
DkCrypto | abstract public class DkCrypto (Code) | | Implements Derive Key cryptography functionality as defined in RFC 3961.
http://www.ietf.org/rfc/rfc3961.txt
This is an abstract class. Concrete subclasses need to implement
the abstract methods.
|
Method Summary | |
static String | bytesToString(byte[] digest) | public byte[] | calculateChecksum(byte[] baseKey, int usage, byte[] input, int start, int len) | static byte[] | charToUtf16(char[] chars) | static byte[] | charToUtf8(char[] chars) | public byte[] | decrypt(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len) | public byte[] | decryptRaw(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len) Decrypts data using specified key and initial vector. | byte[] | dk(byte[] key, byte[] constant) | public byte[] | encrypt(byte[] baseKey, int usage, byte[] ivec, byte[] new_ivec, byte[] plaintext, int start, int len) From RFC 3961. | public byte[] | encryptRaw(byte[] baseKey, int usage, byte[] ivec, byte[] plaintext, int start, int len) Performs encryption using given key only; does not add
confounder, padding, or checksum. | abstract public int | getChecksumLength() | abstract protected Cipher | getCipher(byte[] key, byte[] ivec, int mode) | abstract protected byte[] | getHmac(byte[] key, byte[] plaintext) | abstract protected int | getKeySeedLength() | static byte[] | nfold(byte[] in, int outbits) | abstract protected byte[] | randomToKey(byte[] in) | int | roundup(int n, int blocksize) | static void | traceOutput(String traceTag, byte[] output, int offset, int len) |
KERBEROS_CONSTANT | final static byte[] KERBEROS_CONSTANT(Code) | | |
debug | final protected static boolean debug(Code) | | |
bytesToString | static String bytesToString(byte[] digest)(Code) | | |
charToUtf16 | static byte[] charToUtf16(char[] chars)(Code) | | |
charToUtf8 | static byte[] charToUtf8(char[] chars)(Code) | | |
decrypt | public byte[] decrypt(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len) throws GeneralSecurityException(Code) | | Parameters: baseKey - key from which keys are to be derived using usage Parameters: ciphertext - E(Ke, conf | plaintext | padding, ivec) | H1[1..h] |
decryptRaw | public byte[] decryptRaw(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len) throws GeneralSecurityException(Code) | | Decrypts data using specified key and initial vector.
Parameters: baseKey - encryption key to use Parameters: ciphertext - encrypted data to be decrypted Parameters: usage - ignored |
encrypt | public byte[] encrypt(byte[] baseKey, int usage, byte[] ivec, byte[] new_ivec, byte[] plaintext, int start, int len) throws GeneralSecurityException, KrbCryptoException(Code) | | From RFC 3961.
encryption function conf = random string of length c
pad = shortest string to bring confounder
and plaintext to a length that's a
multiple of m
(C1, newIV) = E(Ke, conf | plaintext | pad,
oldstate.ivec)
H1 = HMAC(Ki, conf | plaintext | pad)
ciphertext = C1 | H1[1..h]
newstate.ivec = newIV
Parameters: ivec - initial vector to use when initializing the cipher; if null,then blocksize number of zeros are used, Parameters: new_ivec - if non-null, it is updated upon return to be the new ivec to use when calling encrypt next time |
encryptRaw | public byte[] encryptRaw(byte[] baseKey, int usage, byte[] ivec, byte[] plaintext, int start, int len) throws GeneralSecurityException, KrbCryptoException(Code) | | Performs encryption using given key only; does not add
confounder, padding, or checksum. Incoming data to be encrypted
assumed to have the correct blocksize.
Ignore key usage.
|
getChecksumLength | abstract public int getChecksumLength()(Code) | | |
getKeySeedLength | abstract protected int getKeySeedLength()(Code) | | |
nfold | static byte[] nfold(byte[] in, int outbits)(Code) | | |
randomToKey | abstract protected byte[] randomToKey(byte[] in)(Code) | | |
roundup | int roundup(int n, int blocksize)(Code) | | |
traceOutput | static void traceOutput(String traceTag, byte[] output, int offset, int len)(Code) | | |
|
|