public class TokenParser extends Object
Constructor and Description |
---|
TokenParser() |
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(KerberosKey key,
byte[] cipher)
Decodes the data.
|
byte[] |
getAP_REQ(InputStream is)
Parses the
InputStream until the AP_REQ is found. |
byte[] |
getEncryptedData(InputStream is)
Parses the
InputStream until the EncryptedData is found. |
KerberosKey |
getKrbKey(Subject sub,
int keyType)
Retrieves the private key from the
Subject . |
String[] |
getNames(InputStream is)
Parses the data to find all the principal names.
|
String |
getPrincipalName()
Returns the principal name of the client.
|
byte[] |
getTicket(InputStream is)
Parses the
InputStream until the Ticket is found. |
byte[] |
getValueAt(InputStream is,
byte type)
Parses the
InputStream until it finds the sequence at position indicated by the byte. |
void |
handleEncryptedData(InputStream is,
int size,
Subject subject)
Decodes the encrypted data and parses the encrypted part to retrieve the client
realm and principal.
|
boolean |
isContextSpecific(byte tag,
byte cntxtTag)
Verify that the tag is the correct one.
|
void |
parseToken(byte[] data,
Subject subject)
Method to be invoked to parse and decode the token.
|
byte[] |
reset(byte[] data)
Resets the size.
|
public void parseToken(byte[] data, Subject subject) throws Exception
public byte[] getValueAt(InputStream is, byte type) throws Exception
InputStream
until it finds the sequence at position indicated by the byte.is
- InputStream
to readtype
- position in the sequenceException
public boolean isContextSpecific(byte tag, byte cntxtTag)
tag
- byte to verifycntxtTag
- byte to matchpublic byte[] getAP_REQ(InputStream is) throws Exception
InputStream
until the AP_REQ is found.is
- InputStream
to readException
public byte[] getTicket(InputStream is) throws Exception
InputStream
until the Ticket is found.is
- InputStream
to readException
public byte[] getEncryptedData(InputStream is) throws Exception
InputStream
until the EncryptedData is found.is
- InputStream
to readException
public void handleEncryptedData(InputStream is, int size, Subject subject) throws Exception
is
- InputStream
to readsize
- encrypted data sizesubject
-
Subject containing the private keyException
public String[] getNames(InputStream is) throws Exception
is
- InputStream
to readException
public KerberosKey getKrbKey(Subject sub, int keyType)
Subject
.sub
- SUbject
containing the private keykeyType
- type of the keypublic byte[] decrypt(KerberosKey key, byte[] cipher) throws NegotiationException
key
- private keycipher
- NegotiationException
public byte[] reset(byte[] data)
data
- public String getPrincipalName()
Copyright © 2013 JBoss by Red Hat. All Rights Reserved.