| java.lang.Object |
| ↳ |
sun.security.mule.krb5.internal.crypto.dk.DkCrypto |
Known Direct Subclasses
| AesDkCrypto |
This class provides the implementation of AES Encryption for Kerberos
as defined RFC 3962. |
| ArcFourCrypto |
Support for ArcFour in Kerberos
as defined in RFC 4757. |
| Des3DkCrypto |
|
|
Class Overview
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.
Summary
| Public Methods |
|
byte[]
|
calculateChecksum(byte[] baseKey, int usage, byte[] input, int start, int len)
|
|
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)
From RFC 3961.
|
|
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
int
|
getChecksumLength()
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
Constants
protected
static
final
boolean
debug
Fields
static
final
byte[]
KERBEROS_CONSTANT
Public Constructors
Public Methods
public
byte[]
calculateChecksum
(byte[] baseKey, int usage, byte[] input, int start, int len)
Parameters
| baseKey
| |
| usage
| |
| input
| |
| start
| |
| len
| |
public
byte[]
decrypt
(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len)
Parameters
| baseKey
| Key from which keys are to be derived using usage |
| usage
| |
| ivec
| |
| ciphertext
| E(Ke, conf | plaintext | padding, ivec) | H1[1..h]
|
| start
| |
| len
| |
public
byte[]
decryptRaw
(byte[] baseKey, int usage, byte[] ivec, byte[] ciphertext, int start, int len)
Decrypts data using specified key and initial vector.
Parameters
| baseKey
| Encryption key to use |
| usage
| Ignored
|
| ivec
| |
| ciphertext
| Encrypted data to be decrypted |
| start
| |
| len
| |
public
byte[]
encrypt
(byte[] baseKey, int usage, byte[] ivec, byte[] new_ivec, byte[] plaintext, int start, int len)
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
| baseKey
| |
| usage
| |
| ivec
| 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
|
| plaintext
| |
| start
| |
| len
| |
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. Incoming data to be encrypted
assumed to have the correct blocksize.
Ignore key usage.
Parameters
| baseKey
| |
| usage
| |
| ivec
| |
| plaintext
| |
| start
| |
| len
| |
public
abstract
int
getChecksumLength
()
Protected Methods
protected
abstract
Cipher
getCipher
(byte[] key, byte[] ivec, int mode)
protected
abstract
byte[]
getHmac
(byte[] key, byte[] plaintext)
protected
abstract
int
getKeySeedLength
()
protected
abstract
byte[]
randomToKey
(byte[] in)