javax.security.auth.kerberos

Class KerberosKey

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

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
voiddestroy()
Destroy this key.
StringgetAlgorithm()
Return the name of the algorithm used to create this key.
byte[]getEncoded()
Return the encoded form of this key.
StringgetFormat()
Return the format of this key.
intgetKeyType()
Return the type of this key.
KerberosPrincipalgetPrincipal()
Return the principal associated with this key.
intgetVersionNumber()
Return the version number of this key.
booleanisDestroyed()
Return true if this key has been destroyed.
StringtoString()

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)
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

Method Detail

destroy

public void destroy()
Destroy this key.

getAlgorithm

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

getEncoded

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

getFormat

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

getKeyType

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

getPrincipal

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

getVersionNumber

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

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.

toString

public String toString()