Package com.hierynomus.spnego
Class NegTokenInit
- java.lang.Object
-
- com.hierynomus.spnego.SpnegoToken
-
- com.hierynomus.spnego.NegTokenInit
-
- Direct Known Subclasses:
NegTokenInit2
public class NegTokenInit extends SpnegoToken
This class can encode and decode the SPNEGO negTokenInit Token. The entire token is an ASN.1 DER encoded sequence of bytes in little endian byte encoding. The following is the full ASN.1 specification of the token:GSSAPI ::= [APPLICATION 0] IMPLICIT SEQUENCE { mech MechType, negTokenInit NegotiationToken } NegotiationToken ::= CHOICE { negTokenInit [0] NegTokenInit, negTokenTarg [1] NegTokenTarg } NegTokenInit ::= SEQUENCE { mechTypes [0] MechTypeList OPTIONAL, reqFlags [1] ContextFlags OPTIONAL, mechToken [2] OCTET STRING OPTIONAL, mechListMIC [3] OCTET STRING OPTIONAL } MechTypeList ::= SEQUENCE of MechType ContextFlags ::= BIT_STRING { delegFlag (0), mutualFlag (1), replayFlag (2), sequenceFlag (3), anonFlag (4), confFlag (5), integFlag (6) } MechType ::= OBJECT IDENTIFIERIn the context of this class only the NegTokenInit is covered.- When an InitToken is sent, it is prepended by the generic GSSAPI header.
- The "mech" field of the GSSAPI header is always set to the SPNEGO OID (1.3.6.1.5.5.2)
- The negTokenInit will have a lead byte of
0xa0(the CHOICE tagged object).
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static java.lang.StringADS_IGNORE_PRINCIPALprotected byte[]mechTokenprivate java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier>mechTypes
-
Constructor Summary
Constructors Constructor Description NegTokenInit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidaddMechToken(java.util.List<com.hierynomus.asn1.types.ASN1Object> negTokenInit)private voidaddMechTypeList(java.util.List<com.hierynomus.asn1.types.ASN1Object> negTokenInit)voidaddSupportedMech(com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier oid)java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier>getSupportedMechTypes()protected voidparseTagged(com.hierynomus.asn1.types.constructed.ASN1TaggedObject asn1TaggedObject)NegTokenInitread(byte[] bytes)private NegTokenInitread(Buffer<?> buffer)(package private) voidreadMechToken(com.hierynomus.asn1.types.ASN1Object<?> mechToken)(package private) voidreadMechTypeList(com.hierynomus.asn1.types.ASN1Object<?> sequence)voidsetMechToken(byte[] mechToken)voidwrite(Buffer<?> buffer)-
Methods inherited from class com.hierynomus.spnego.SpnegoToken
parseSpnegoToken, writeGss
-
-
-
-
Field Detail
-
ADS_IGNORE_PRINCIPAL
static final java.lang.String ADS_IGNORE_PRINCIPAL
- See Also:
- Constant Field Values
-
mechTypes
private java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier> mechTypes
-
mechToken
protected byte[] mechToken
-
-
Method Detail
-
write
public void write(Buffer<?> buffer) throws SpnegoException
- Specified by:
writein classSpnegoToken- Throws:
SpnegoException
-
read
public NegTokenInit read(byte[] bytes) throws SpnegoException
- Throws:
SpnegoException
-
read
private NegTokenInit read(Buffer<?> buffer) throws SpnegoException
- Throws:
SpnegoException
-
parseTagged
protected void parseTagged(com.hierynomus.asn1.types.constructed.ASN1TaggedObject asn1TaggedObject) throws SpnegoException- Specified by:
parseTaggedin classSpnegoToken- Throws:
SpnegoException
-
readMechToken
void readMechToken(com.hierynomus.asn1.types.ASN1Object<?> mechToken) throws SpnegoException- Throws:
SpnegoException
-
readMechTypeList
void readMechTypeList(com.hierynomus.asn1.types.ASN1Object<?> sequence) throws SpnegoException- Throws:
SpnegoException
-
addMechToken
private void addMechToken(java.util.List<com.hierynomus.asn1.types.ASN1Object> negTokenInit)
-
addMechTypeList
private void addMechTypeList(java.util.List<com.hierynomus.asn1.types.ASN1Object> negTokenInit)
-
addSupportedMech
public void addSupportedMech(com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier oid)
-
setMechToken
public void setMechToken(byte[] mechToken)
-
getSupportedMechTypes
public java.util.List<com.hierynomus.asn1.types.primitive.ASN1ObjectIdentifier> getSupportedMechTypes()
-
-