|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.shared.asn1.AbstractAsn1Object
org.apache.directory.shared.kerberos.components.EncryptedData
public class EncryptedData
A structure storing an encrypted data element. The ASN.1 grammar is :
EncryptedData ::= SEQUENCE {
etype [0] Int32 -- EncryptionType --,
kvno [1] UInt32 OPTIONAL,
cipher [2] OCTET STRING -- ciphertext
}
| Field Summary | |
|---|---|
static boolean |
HAS_KVNO
A constant used when the key is not present |
| Constructor Summary | |
|---|---|
EncryptedData()
Creates a new instance of EncryptedData. |
|
EncryptedData(EncryptionType eType,
byte[] cipher)
Creates a new instance of EncryptedData. |
|
EncryptedData(EncryptionType eType,
int kvno,
byte[] cipher)
Creates a new instance of EncryptedData. |
|
| Method Summary | |
|---|---|
int |
computeLength()
Compute the EncryptedData length |
ByteBuffer |
encode(ByteBuffer buffer)
Encode the EncryptedData message to a PDU. |
boolean |
equals(Object obj)
|
byte[] |
getCipher()
Returns the raw cipher text. |
EncryptionType |
getEType()
Returns the EncryptionType. |
int |
getKvno()
Returns the key version. |
int |
hashCode()
|
boolean |
hasKvno()
Tells if there is a key version. |
void |
setCipher(byte[] cipher)
Set the cipher text |
void |
setEType(EncryptionType eType)
Set the EncryptionType |
void |
setKvno(int kvno)
Set the key version |
String |
toString()
|
String |
toString(String tabs)
|
| Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object |
|---|
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean HAS_KVNO
| Constructor Detail |
|---|
public EncryptedData()
public EncryptedData(EncryptionType eType,
int kvno,
byte[] cipher)
eType - The encription algorithmkvno - The key versioncipher - the encrypted text
public EncryptedData(EncryptionType eType,
byte[] cipher)
eType - The encription algorithmcipher - the encrypted text| Method Detail |
|---|
public EncryptionType getEType()
EncryptionType.
EncryptionType.public void setEType(EncryptionType eType)
eType - the EncryptionTypepublic int getKvno()
public void setKvno(int kvno)
kvno - The key versionpublic boolean hasKvno()
true if there is a key version.public byte[] getCipher()
public void setCipher(byte[] cipher)
cipher - The cipher textpublic int computeLength()
EncryptedData :
0x30 L1 EncryptedData sequence
|
+--> 0xA1 L2 etype tag
| |
| +--> 0x02 L2-1 etype (int)
|
+--> [0xA2 L3 kvno tag
| |
| +--> 0x30 L3-1 kvno (int)] (optional)
|
+--> 0xA2 L4 cipher tag
|
+--> 0x04 L4-1 cipher (OCTET STRING)
public ByteBuffer encode(ByteBuffer buffer)
throws org.apache.directory.shared.asn1.EncoderException
EncryptedData :
0x30 LL
0xA0 LL
0x02 0x01 etype (integer)
[0xA1 LL
0x02 0x01 kvno (integer)] (optional)
0xA2 LL
0x04 LL cipher (OCTET STRING)
encode in interface org.apache.directory.shared.asn1.Asn1Objectencode in class org.apache.directory.shared.asn1.AbstractAsn1Objectbuffer - The buffer where to put the PDU. It should have been allocated
before, with the right size.
org.apache.directory.shared.asn1.EncoderExceptionpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String toString()
toString in class ObjectObject.toString()public String toString(String tabs)
Object.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||