Package org.apache.kerby.asn1.type
Class Asn1Choice
- All Implemented Interfaces:
Asn1Dumpable,Asn1Type
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.kerby.asn1.type.Asn1Type
Asn1Type.EncodingType -
Field Summary
Fields inherited from class org.apache.kerby.asn1.type.Asn1Encodeable
bodyLength, outerEncodeable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(ByteBuffer content) Decode the content bytes into this type.voiddecode(Asn1ParseResult parseResult) protected voiddecodeBody(Asn1ParseResult parseResult) voiddumpWith(Asn1Dumper dumper, int indents) byte[]encode()Encode the type, by recursively.voidencode(ByteBuffer buffer) Encode the type, by recursively, using the provided buffer.protected voidencodeBody(ByteBuffer buffer) protected intintGet length of encoding bytes by just calculating without real encoding.protected <T extends Asn1Type>
TgetChoiceValueAs(EnumType index, Class<T> t) protected byte[]getChoiceValueAsOctets(EnumType index) booleanmatchAndSetValue(Tag tag) protected voidsetChoiceValue(EnumType index, Asn1Type value) protected voidsetChoiceValueAsOctets(EnumType index, byte[] bytes) tag()Methods inherited from class org.apache.kerby.asn1.type.AbstractAsn1Type
getValue, setValue, toStringMethods inherited from class org.apache.kerby.asn1.type.Asn1Encodeable
decode, encodingHeaderLength, getBodyLength, getHeaderLength, isBER, isCER, isDefinitiveLength, isDER, isImplicit, isPrimitive, resetBodyLength, taggedDecode, taggedDecode, taggedDecode, taggedEncode, taggedEncode, taggedEncodingLength, useBER, useCER, useDefinitiveLength, useDER, useImplicit, usePrimitiveMethods inherited from class org.apache.kerby.asn1.type.Asn1Object
isAppSpecific, isCollection, isContextSpecific, isEOC, isNull, isSimple, isTagSpecific, isUniversal, simpleInfo, tagFlags, tagNo
-
Constructor Details
-
Asn1Choice
-
-
Method Details
-
tag
- Specified by:
tagin interfaceAsn1Type- Overrides:
tagin classAsn1Object- Returns:
- The tag
-
matchAndSetValue
-
encode
Description copied from interface:Asn1TypeEncode the type, by recursively.- Specified by:
encodein interfaceAsn1Type- Overrides:
encodein classAsn1Encodeable- Returns:
- encoded bytes
- Throws:
IOException
-
encode
Description copied from interface:Asn1TypeEncode the type, by recursively, using the provided buffer.- Specified by:
encodein interfaceAsn1Type- Overrides:
encodein classAsn1Encodeable- Parameters:
buffer- The byte buffer- Throws:
IOException
-
encodingLength
public int encodingLength()Description copied from interface:Asn1TypeGet length of encoding bytes by just calculating without real encoding. Generally it's called to prepare for the encoding buffer.- Specified by:
encodingLengthin interfaceAsn1Type- Overrides:
encodingLengthin classAsn1Encodeable- Returns:
- length of encoding bytes
-
encodingBodyLength
protected int encodingBodyLength()- Specified by:
encodingBodyLengthin classAsn1Encodeable
-
encodeBody
- Overrides:
encodeBodyin classAsn1Encodeable- Throws:
IOException
-
decode
Description copied from interface:Asn1TypeDecode the content bytes into this type.- Specified by:
decodein interfaceAsn1Type- Overrides:
decodein classAsn1Encodeable- Parameters:
content- The content bytes- Throws:
IOException- e
-
decode
- Overrides:
decodein classAsn1Encodeable- Throws:
IOException
-
decodeBody
- Specified by:
decodeBodyin classAsn1Encodeable- Throws:
IOException
-
getChoiceValueAs
-
setChoiceValue
-
setChoiceValueAsOctets
-
getChoiceValueAsOctets
-
dumpWith
- Specified by:
dumpWithin interfaceAsn1Dumpable
-