org.apache.directory.server.kerberos.shared.crypto.encryption
Class CipherTextHandler
java.lang.Object
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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CipherTextHandler
public CipherTextHandler()
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 datadata - The data to decryptusage - 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.