org.apache.directory.server.kerberos.shared.crypto.encryption
Class Des3CbcSha1KdEncryption

java.lang.Object
  extended by org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionEngine
      extended by org.apache.directory.server.kerberos.shared.crypto.encryption.Des3CbcSha1KdEncryption
All Implemented Interfaces:
ChecksumEngine

public class Des3CbcSha1KdEncryption
extends EncryptionEngine
implements ChecksumEngine

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Constructor Summary
Des3CbcSha1KdEncryption()
           
 
Method Summary
 byte[] calculateChecksum(byte[] data, byte[] key, KeyUsage usage)
          Calculate a checksum given raw bytes and an (optional) key.
 byte[] calculateIntegrity(byte[] data, byte[] key, KeyUsage usage)
           
 ChecksumType checksumType()
          Returns the checksum type of this checksum engine.
 byte[] decrypt(byte[] cipherText, byte[] keyBytes)
           
protected  byte[] deriveKey(byte[] baseKey, byte[] usage, int n, int k)
          Derived Key = DK(Base Key, Well-Known Constant) DK(Key, Constant) = random-to-key(DR(Key, Constant)) DR(Key, Constant) = k-truncate(E(Key, Constant, initial-cipher-state))
 byte[] encrypt(byte[] plainText, byte[] keyBytes)
           
protected  byte[] getBitGroup(byte[] seed, int group)
           
 int getChecksumLength()
           
 int getConfounderLength()
           
 byte[] getDecryptedData(EncryptionKey key, EncryptedData data, KeyUsage usage)
           
 EncryptedData getEncryptedData(EncryptionKey key, byte[] plainText, KeyUsage usage)
           
 EncryptionType getEncryptionType()
           
protected  byte[] randomToKey(byte[] seed)
           
protected  byte[] setParity(byte[] in)
           
 
Methods inherited from class org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionEngine
concatenateBytes, deriveRandom, getBit, getRandomBytes, getUsageKc, getUsageKe, getUsageKi, padString, removeLeadingBytes, removeTrailingBytes, setBit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Des3CbcSha1KdEncryption

public Des3CbcSha1KdEncryption()
Method Detail

getEncryptionType

public EncryptionType getEncryptionType()
Specified by:
getEncryptionType in class EncryptionEngine

getConfounderLength

public int getConfounderLength()
Specified by:
getConfounderLength in class EncryptionEngine

getChecksumLength

public int getChecksumLength()
Specified by:
getChecksumLength in class EncryptionEngine

checksumType

public ChecksumType checksumType()
Description copied from interface: ChecksumEngine
Returns the checksum type of this checksum engine.

Specified by:
checksumType in interface ChecksumEngine
Returns:
The checksum type.

calculateChecksum

public byte[] calculateChecksum(byte[] data,
                                byte[] key,
                                KeyUsage usage)
Description copied from interface: ChecksumEngine
Calculate a checksum given raw bytes and an (optional) key.

Specified by:
calculateChecksum in interface ChecksumEngine
Returns:
The checksum value.

calculateIntegrity

public byte[] calculateIntegrity(byte[] data,
                                 byte[] key,
                                 KeyUsage usage)
Specified by:
calculateIntegrity in class EncryptionEngine

getDecryptedData

public byte[] getDecryptedData(EncryptionKey key,
                               EncryptedData data,
                               KeyUsage usage)
                        throws KerberosException
Specified by:
getDecryptedData in class EncryptionEngine
Throws:
KerberosException

getEncryptedData

public EncryptedData getEncryptedData(EncryptionKey key,
                                      byte[] plainText,
                                      KeyUsage usage)
Specified by:
getEncryptedData in class EncryptionEngine

encrypt

public byte[] encrypt(byte[] plainText,
                      byte[] keyBytes)
Specified by:
encrypt in class EncryptionEngine

decrypt

public byte[] decrypt(byte[] cipherText,
                      byte[] keyBytes)
Specified by:
decrypt in class EncryptionEngine

deriveKey

protected byte[] deriveKey(byte[] baseKey,
                           byte[] usage,
                           int n,
                           int k)
Derived Key = DK(Base Key, Well-Known Constant) DK(Key, Constant) = random-to-key(DR(Key, Constant)) DR(Key, Constant) = k-truncate(E(Key, Constant, initial-cipher-state))


randomToKey

protected byte[] randomToKey(byte[] seed)

getBitGroup

protected byte[] getBitGroup(byte[] seed,
                             int group)

setParity

protected byte[] setParity(byte[] in)


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.