sun.security.mule.krb5.internal.crypto
Class DesCbcCrcEType

java.lang.Object
  extended by sun.security.mule.krb5.internal.crypto.EType
      extended by sun.security.mule.krb5.internal.crypto.DesCbcCrcEType

public class DesCbcCrcEType
extends EType


Constructor Summary
DesCbcCrcEType()
           
 
Method Summary
 int blockSize()
           
protected  byte[] calculateChecksum(byte[] data, int size)
           
 int checksumSize()
           
 int checksumType()
           
 int confounderSize()
           
 byte[] decrypt(byte[] cipher, byte[] key, byte[] ivec, int usage)
          Decrypts the data using DES in CBC mode.
 byte[] decrypt(byte[] cipher, byte[] key, int usage)
          Decrypts data with provided key using DES in CBC mode with CRC32.
 byte[] encrypt(byte[] data, byte[] key, byte[] ivec, int usage)
          Encrypts the data using DES in CBC mode.
 byte[] encrypt(byte[] data, byte[] key, int usage)
          Encrypts data using DES in CBC mode with CRC32.
 int eType()
           
protected  boolean isChecksumValid(byte[] data)
           
 int keySize()
           
 int keyType()
           
 int minimumPadSize()
           
 
Methods inherited from class sun.security.mule.krb5.internal.crypto.EType
dataSize, decryptedData, getBuiltInDefaults, getDefaults, getDefaults, getInstance, isSupported, isSupported, padSize, startOfChecksum, startOfData, startOfPad, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DesCbcCrcEType

public DesCbcCrcEType()
Method Detail

eType

public int eType()
Specified by:
eType in class EType

minimumPadSize

public int minimumPadSize()
Specified by:
minimumPadSize in class EType

confounderSize

public int confounderSize()
Specified by:
confounderSize in class EType

checksumType

public int checksumType()
Specified by:
checksumType in class EType

checksumSize

public int checksumSize()
Specified by:
checksumSize in class EType

encrypt

public byte[] encrypt(byte[] data,
                      byte[] key,
                      int usage)
               throws KrbCryptoException
Encrypts data using DES in CBC mode with CRC32.

Parameters:
data - the data to be encrypted.
key - the secret key to encrypt the data. It is also used as initialization vector during cipher block chaining.
Returns:
the buffer for cipher text.
Throws:
KrbCryptoException

decrypt

public byte[] decrypt(byte[] cipher,
                      byte[] key,
                      int usage)
               throws KrbApErrException,
                      KrbCryptoException
Decrypts data with provided key using DES in CBC mode with CRC32.

Parameters:
cipher - the cipher text to be decrypted.
key - the secret key to decrypt the data.
Throws:
KrbApErrException
KrbCryptoException

calculateChecksum

protected byte[] calculateChecksum(byte[] data,
                                   int size)

blockSize

public int blockSize()
Specified by:
blockSize in class EType

keyType

public int keyType()
Specified by:
keyType in class EType

keySize

public int keySize()
Specified by:
keySize in class EType

encrypt

public byte[] encrypt(byte[] data,
                      byte[] key,
                      byte[] ivec,
                      int usage)
               throws KrbCryptoException
Encrypts the data using DES in CBC mode.

Specified by:
encrypt in class EType
Parameters:
data - the buffer for plain text.
key - the key to encrypt the data.
ivec - initialization vector.
Returns:
buffer for encrypted data.
Throws:
KrbCryptoException

decrypt

public byte[] decrypt(byte[] cipher,
                      byte[] key,
                      byte[] ivec,
                      int usage)
               throws KrbApErrException,
                      KrbCryptoException
Decrypts the data using DES in CBC mode.

Specified by:
decrypt in class EType
Parameters:
cipher - the input buffer.
key - the key to decrypt the data.
ivec - initialization vector.
Throws:
KrbApErrException
KrbCryptoException

isChecksumValid

protected boolean isChecksumValid(byte[] data)
                           throws KrbCryptoException
Throws:
KrbCryptoException


Copyright © 2013. All Rights Reserved.