Class KerberosCredMessage
java.lang.Object
javax.security.auth.kerberos.KerberosCredMessage
- All Implemented Interfaces:
Destroyable
This class encapsulates a Kerberos 5 KRB_CRED message which can be used to
send Kerberos credentials from one principal to another.
A KRB_CRED message is defined in Section 5.8.1 of the Kerberos Protocol Specification (RFC 4120) as:
KRB-CRED ::= [APPLICATION 22] SEQUENCE {
pvno [0] INTEGER (5),
msg-type [1] INTEGER (22),
tickets [2] SEQUENCE OF Ticket,
enc-part [3] EncryptedData -- EncKrbCredPart
}
- Since:
- 9
-
Constructor Summary
ConstructorsConstructorDescriptionKerberosCredMessage(KerberosPrincipal sender, KerberosPrincipal recipient, byte[] message) Constructs aKerberosCredMessageobject. -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Destroys this object by clearing out the message.booleanCompares the specified object with thisKerberosCredMessagefor equality.byte[]Returns the DER encoded form of the KRB_CRED message.Returns the recipient of this message.Returns the sender of this message.inthashCode()Returns a hash code for thisKerberosCredMessage.toString()Returns an informative textual representation of thisKerberosCredMessage.Methods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.Methods declared in interface Destroyable
isDestroyedModifier and TypeMethodDescriptiondefault booleanDetermine if thisObjecthas been destroyed.
-
Constructor Details
-
KerberosCredMessage
Constructs aKerberosCredMessageobject.The contents of the
messageargument are copied; subsequent modification of the byte array does not affect the newly created object.- Parameters:
sender- the sender of the messagerecipient- the recipient of the messagemessage- the DER encoded KRB_CRED message- Throws:
NullPointerException- if any of sender, recipient or message is null
-
-
Method Details
-
getEncoded
public byte[] getEncoded()Returns the DER encoded form of the KRB_CRED message.- Returns:
- a newly allocated byte array that contains the encoded form
- Throws:
IllegalStateException- if the object is destroyed
-
getSender
Returns the sender of this message.- Returns:
- the sender
- Throws:
IllegalStateException- if the object is destroyed
-
getRecipient
Returns the recipient of this message.- Returns:
- the recipient
- Throws:
IllegalStateException- if the object is destroyed
-
destroy
public void destroy()Destroys this object by clearing out the message.- Specified by:
destroyin interfaceDestroyable
-
toString
-
hashCode
-
equals
Compares the specified object with thisKerberosCredMessagefor equality. Returns true if the given object is also aKerberosCredMessageand the twoKerberosCredMessageinstances are equivalent. More formally twoKerberosCredMessageinstances are equal if they have equal sender, recipient, and encoded KRB_CRED messages. A destroyedKerberosCredMessageobject is only equal to itself.
-