aicas logoJamaica 3.2 release 62

javax.security.auth.kerberos
Class KerberosKey

java.lang.Object
  extended by javax.security.auth.kerberos.KerberosKey
All Implemented Interfaces:
Serializable, Key, SecretKey, Destroyable

public class KerberosKey
extends Object
implements Serializable, SecretKey, Destroyable

This class represents a Kerberos key. See the Kerberos authentication RFC for more information: RFC 1510.

Since:
1.4
See Also:
Serialized Form

Constructor Summary
KerberosKey(KerberosPrincipal principal, byte[] key, int type, int version)
          Construct a new key with the indicated principal and key.
KerberosKey(KerberosPrincipal principal, char[] passwd, String algo)
          Construct a new key with the indicated principal and a password.
 
Method Summary
 void destroy()
          Destroy this key.
 String getAlgorithm()
          Return the name of the algorithm used to create this key.
 byte[] getEncoded()
          Return the encoded form of this key.
 String getFormat()
          Return the format of this key.
 int getKeyType()
          Return the type of this key.
 KerberosPrincipal getPrincipal()
          Return the principal associated with this key.
 int getVersionNumber()
          Return the version number of this key.
 boolean isDestroyed()
          Return true if this key has been destroyed.
 String toString()
          toString creates a printable string that represents this object for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KerberosKey

public KerberosKey(KerberosPrincipal principal,
                   byte[] key,
                   int type,
                   int version)
Construct a new key with the indicated principal and key.

Parameters:
principal - the principal
key - the key's data
type - the key's type
version - the key's version number

KerberosKey

public KerberosKey(KerberosPrincipal principal,
                   char[] passwd,
                   String algo)
            throws gnu.classpath.NotImplementedException
Construct a new key with the indicated principal and a password.

Parameters:
principal - the principal
passwd - the password to use
algo - the algorithm; if null the "DES" algorithm is used
Throws:
gnu.classpath.NotImplementedException
Method Detail

getAlgorithm

public final String getAlgorithm()
Return the name of the algorithm used to create this key.

Specified by:
getAlgorithm in interface Key
Returns:
the name of the algorithm in use

getFormat

public final String getFormat()
Return the format of this key. This implementation always returns "RAW".

Specified by:
getFormat in interface Key
Returns:
the name of the encoding format for this key, or null

getPrincipal

public final KerberosPrincipal getPrincipal()
Return the principal associated with this key.


getKeyType

public final int getKeyType()
Return the type of this key.


getVersionNumber

public final int getVersionNumber()
Return the version number of this key.


getEncoded

public final byte[] getEncoded()
Return the encoded form of this key.

Specified by:
getEncoded in interface Key
Returns:
the encoded form of the key, or null

destroy

public void destroy()
             throws DestroyFailedException
Destroy this key.

Specified by:
destroy in interface Destroyable
Throws:
DestroyFailedException - If this object could not be destroyed.

isDestroyed

public boolean isDestroyed()
Return true if this key has been destroyed. After this has been called, other methods on this object will throw IllegalStateException.

Specified by:
isDestroyed in interface Destroyable
Returns:
True if this object has been destroyed.

toString

public String toString()
Description copied from class: Object
toString creates a printable string that represents this object for debugging purposes.

The default implementation returns getClass().getName() + '@' + Integer.toHexString(hashCode()).

Overrides:
toString in class Object
Returns:
a string identifying this object.

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.