public class KdcRep extends KerberosMessage
KDC-REP ::= SEQUENCE { pvno [0] INTEGER (5), msg-type [1] INTEGER (11 -- AS -- | 13 -- TGS --), padata [2] SEQUENCE OF PA-DATA OPTIONAL -- NOTE: not empty --, crealm [3] Realm, cname [4] <PrincipalName>, ticket [5] <Ticket@gt;, enc-part [6] <EncryptedData> -- EncASRepPart or EncTGSRepPart, -- as appropriate }
Modifier and Type | Field and Description |
---|---|
protected EncKdcRepPart |
encKdcRepPart
The decoded KDC-REP part
|
Constructor and Description |
---|
KdcRep(KerberosMessageType msgType)
Creates a new instance of KDC-REP.
|
Modifier and Type | Method and Description |
---|---|
void |
addPaData(PaData paData) |
int |
computeLength()
Compute the KDC-REP length
|
ByteBuffer |
encode(ByteBuffer buffer)
Encode the KDC-REP component
|
PrincipalName |
getCName()
Returns the client
PrincipalName . |
String |
getCRealm()
Returns the client realm.
|
EncKdcRepPart |
getEncKdcRepPart() |
EncryptedData |
getEncPart()
Returns the encrypted part as
EncryptedData . |
List<PaData> |
getPaData() |
int |
getPvno() |
Ticket |
getTicket()
Returns the
Ticket |
void |
setCName(PrincipalName cname)
Set the client principalName
|
void |
setCRealm(String crealm)
Set the client realm
|
void |
setEncKdcRepPart(EncKdcRepPart encKdcRepPart) |
void |
setEncPart(EncryptedData encPart) |
void |
setPvno(int pvno) |
void |
setTicket(Ticket ticket)
Set the Ticket
|
String |
toString() |
String |
toString(String tabs)
Pretty print the instance
|
getMessageType, getProtocolVersionNumber, setMessageType, setProtocolVersionNumber
protected EncKdcRepPart encKdcRepPart
public KdcRep(KerberosMessageType msgType)
public int getPvno()
public void setPvno(int pvno)
pvno
- the pvno to setpublic void setCRealm(String crealm)
crealm
- the client realmpublic PrincipalName getCName()
PrincipalName
.PrincipalName
.public void setCName(PrincipalName cname)
cname
- the client principalNamepublic void setTicket(Ticket ticket)
ticket
- the ticket to setpublic EncryptedData getEncPart()
EncryptedData
.EncryptedData
.public void setEncPart(EncryptedData encPart)
encPart
- the encPart to setpublic EncKdcRepPart getEncKdcRepPart()
public void setEncKdcRepPart(EncKdcRepPart encKdcRepPart)
encKdcRepPart
- the encKdcRepPart to setpublic int computeLength()
KDC-REP : 0x30 L1 KDC-REP sequence | +--> 0xA0 0x03 pvno tag | | | +--> 0x02 0x01 0x05 pvno (5) | +--> 0xA1 0x03 msg-type tag | | | +--> 0x02 0x01 0x0B/0x0D msg-type : either AS-REP (0x0B) or TGS-REP (0x0D) | +--> 0xA2 L2 pa-data tag | | | +--> 0x30 L2-1 pa-data SEQ | | | +--> 0x30 L2-1-1 pa-data | | | +--> 0x30 L2-1-2 pa-data | : | +--> 0xA3 L3 crealm tag | | | +--> 0x1B L3-1 crealm | +--> 0xA4 L4 cname tag | | | +--> 0x30 L4-1 cname | +--> 0xA5 L5 ticket tag | | | +--> 0x61 L5-1 ticket | +--> 0xA6 L6 enc-part tag | +--> 0x30 L6-1 enc-part
public ByteBuffer encode(ByteBuffer buffer) throws org.apache.directory.api.asn1.EncoderException
buffer
- The buffer containing the encoded resultorg.apache.directory.api.asn1.EncoderException
- If the encoding failedpublic String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.