org.apache.directory.server.kerberos.shared.messages.value
Class EncryptionKey

java.lang.Object
  extended by org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey

public class EncryptionKey
extends java.lang.Object

A Kerberos symmetric encryption key, which includes metadata support for the associated key type and key version number.

Version:
$Rev: 540371 $, $Date: 2007-05-21 20:00:43 -0400 (Mon, 21 May 2007) $
Author:
Apache Directory Project

Constructor Summary
EncryptionKey(EncryptionType keyType, byte[] keyValue)
          Creates a new instance of EncryptionKey.
EncryptionKey(EncryptionType keyType, byte[] keyValue, int keyVersion)
          Creates a new instance of EncryptionKey.
 
Method Summary
 void destroy()
          Destroys this key by overwriting the symmetric key material with zeros.
 boolean equals(java.lang.Object o)
           
 EncryptionType getKeyType()
          Returns the key type.
 byte[] getKeyValue()
          Returns the key value.
 int getKeyVersion()
          Returns the key version.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncryptionKey

public EncryptionKey(EncryptionType keyType,
                     byte[] keyValue)
Creates a new instance of EncryptionKey.

Parameters:
keyType -
keyValue -

EncryptionKey

public EncryptionKey(EncryptionType keyType,
                     byte[] keyValue,
                     int keyVersion)
Creates a new instance of EncryptionKey. This constructor supports 'keyVersion', which is sent over the wire as part of EncryptedData but makes more sense in the domain model to have here as part of the key itself. Therefore, the keyVersion should only be constructor-injected when EncryptionKey's are retrieved from persisted storage.

Parameters:
keyType -
keyValue -
keyVersion -
Method Detail

destroy

public void destroy()
Destroys this key by overwriting the symmetric key material with zeros.


getKeyType

public EncryptionType getKeyType()
Returns the key type.

Returns:
The key type.

getKeyValue

public byte[] getKeyValue()
Returns the key value.

Returns:
The key value.

getKeyVersion

public int getKeyVersion()
Returns the key version.

Returns:
The key version.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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