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

java.lang.Object
  extended by org.apache.directory.server.kerberos.shared.crypto.encryption.CipherTextHandler

public class CipherTextHandler
extends Object

A Hashed Adapter encapsulating ASN.1 cipher text engines to perform encrypt() and decrypt() operations.

Author:
Apache Directory Project

Constructor Summary
CipherTextHandler()
           
 
Method Summary
 byte[] decrypt(EncryptionKey key, EncryptedData data, KeyUsage usage)
          Decrypt a block of data.
 EncryptedData encrypt(EncryptionKey key, byte[] plainText, KeyUsage usage)
           
 EncryptedData seal(EncryptionKey key, org.apache.directory.shared.asn1.AbstractAsn1Object message, KeyUsage usage)
          Performs an encode and an encrypt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CipherTextHandler

public CipherTextHandler()
Method Detail

seal

public EncryptedData seal(EncryptionKey key,
                          org.apache.directory.shared.asn1.AbstractAsn1Object message,
                          KeyUsage usage)
                   throws KerberosException
Performs an encode and an encrypt.

Parameters:
key - The key to use for encrypting.
encodable - The Kerberos object to encode.
usage - The key usage.
Returns:
The Kerberos EncryptedData.
Throws:
KerberosException

encrypt

public EncryptedData encrypt(EncryptionKey key,
                             byte[] plainText,
                             KeyUsage usage)
                      throws KerberosException
Throws:
KerberosException

decrypt

public byte[] decrypt(EncryptionKey key,
                      EncryptedData data,
                      KeyUsage usage)
               throws KerberosException
Decrypt a block of data.

Parameters:
key - The key used to decrypt the data
data - The data to decrypt
usage - The key usage number
Returns:
The decrypted data as a byte[]
Throws:
KerberosException - If the decoding failed


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.