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
ConstructorDescriptionKerberosCredMessage
(KerberosPrincipal sender, KerberosPrincipal recipient, byte[] message) Constructs aKerberosCredMessage
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroys this object by clearing out the message.boolean
Compares the specified object with thisKerberosCredMessage
for equality.byte[]
Returns the DER encoded form of the KRB_CRED message.Returns the recipient of this message.Returns the sender of this message.int
hashCode()
Returns a hash code for thisKerberosCredMessage
.toString()
Returns an informative textual representation of thisKerberosCredMessage
.Methods declared in class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods declared in interface javax.security.auth.Destroyable
isDestroyed
-
Constructor Details
-
KerberosCredMessage
Constructs aKerberosCredMessage
object.The contents of the
message
argument 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:
destroy
in interfaceDestroyable
-
toString
-
hashCode
-
equals
Compares the specified object with thisKerberosCredMessage
for equality. Returns true if the given object is also aKerberosCredMessage
and the twoKerberosCredMessage
instances are equivalent. More formally twoKerberosCredMessage
instances are equal if they have equal sender, recipient, and encoded KRB_CRED messages. A destroyedKerberosCredMessage
object is only equal to itself.
-