|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.security.auth.kerberos.KerberosKey
public class KerberosKey
This class encapsulates a long term secret key for a Kerberos principal.
All Kerberos JAAS login modules that obtain a principal's password and
generate the secret key from it should use this class. Where available, the
login module might even read this secret key directly from a Kerberos
"keytab". Sometimes, such as when authenticating a server in the absence of
user-to-user authentication, the login module will store an instance of
this class in the private credential set of a Subject
during the commit phase of the
authentication process.
It might be necessary for the application to be granted a PrivateCredentialPermission
if it needs to access the KerberosKey instance
from a Subject. This permission is not needed when the application depends
on the default JGSS Kerberos mechanism to access the KerberosKey. In that
case, however, the application will need an appropriate ServicePermission
.
Constructor Summary | |
---|---|
KerberosKey(KerberosPrincipal principal,
byte[] keyBytes,
int keyType,
int versionNum)
Constructs a KerberosKey from the given bytes when the key type and key version number are known. |
|
KerberosKey(KerberosPrincipal principal,
char[] password,
java.lang.String algorithm)
Constructs a KerberosKey from a principal's password. |
Method Summary | |
---|---|
void |
destroy()
Destroys this key. |
java.lang.String |
getAlgorithm()
Returns the standard algorithm name for this key. |
byte[] |
getEncoded()
Returns the key material of this secret key. |
java.lang.String |
getFormat()
Returns the name of the encoding format for this secret key. |
int |
getKeyType()
Returns the key type for this long-term key. |
KerberosPrincipal |
getPrincipal()
Returns the principal that this key belongs to. |
int |
getVersionNumber()
Returns the key version number. |
boolean |
isDestroyed()
Determines if this key has been destroyed. |
java.lang.String |
toString()
DOCUMENT ME! |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public KerberosKey(KerberosPrincipal principal, byte[] keyBytes, int keyType, int versionNum)
principal
- the principal that this secret key belongs tokeyBytes
- the raw bytes for the secret keykeyType
- the key type for the secret key as defined by the
Kerberos protocol specification.versionNum
- the version number of this secret keypublic KerberosKey(KerberosPrincipal principal, char[] password, java.lang.String algorithm)
principal
- the principal that this password belongs topassword
- the password that should be used to compute the keyalgorithm
- the name for the algorithm that this key wil be used
for. This parameter may be null in which case "DES" will be
assumed.Method Detail |
---|
public final KerberosPrincipal getPrincipal()
public final int getVersionNumber()
public final int getKeyType()
public final java.lang.String getAlgorithm()
getAlgorithm
in interface java.security.Key
public final java.lang.String getFormat()
getFormat
in interface java.security.Key
public final byte[] getEncoded()
getEncoded
in interface java.security.Key
public void destroy() throws javax.security.auth.DestroyFailedException
destroy
in interface javax.security.auth.Destroyable
javax.security.auth.DestroyFailedException
- if some error occurs while destorying
this key.public boolean isDestroyed()
isDestroyed
in interface javax.security.auth.Destroyable
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |