Package org.apache.kerby.asn1.type
Class Asn1TaggingCollection
java.lang.Object
org.apache.kerby.asn1.type.Asn1Object
org.apache.kerby.asn1.type.Asn1Encodeable
org.apache.kerby.asn1.type.AbstractAsn1Type<Asn1CollectionType>
org.apache.kerby.asn1.type.Asn1TaggingCollection
- All Implemented Interfaces:
Asn1Dumpable,Asn1Type
- Direct Known Subclasses:
Asn1TaggingSequence,Asn1TaggingSet
public abstract class Asn1TaggingCollection
extends AbstractAsn1Type<Asn1CollectionType>
implements Asn1Dumpable
For tagging a collection type with tagNo, either application specific or
context specific class
-
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
ConstructorsConstructorDescriptionAsn1TaggingCollection(int taggingTagNo, Asn1FieldInfo[] tags, boolean isAppSpecific, boolean isImplicit) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Asn1CollectionTypecreateTaggedCollection(Asn1FieldInfo[] tags) voiddecode(ByteBuffer content) Decode the content bytes into this type.protected voiddecodeBody(Asn1ParseResult parseResult) voiddumpWith(Asn1Dumper dumper, int indents) protected voidencodeBody(ByteBuffer buffer) protected intprotected <T extends Asn1Type>
TgetFieldAs(EnumType index, Class<T> t) protected IntegergetFieldAsInteger(EnumType index) protected byte[]getFieldAsOctetBytes(EnumType index) protected byte[]getFieldAsOctets(EnumType index) protected StringgetFieldAsString(EnumType index) booleanisBER()Tells if it's is BERbooleanisCER()Tells if it's is CERbooleanTells if it's definitive length or not.booleanisDER()Tells if it's is DERbooleanTells if it's is IMPLICIT or not.booleanTells if it is PRIMITIVE or not.protected voidsetFieldAs(EnumType index, Asn1Type value) protected voidsetFieldAsInt(EnumType index, int value) protected voidsetFieldAsOctetBytes(EnumType index, byte[] value) protected voidsetFieldAsOctets(EnumType index, byte[] bytes) tag()inttagNo()voiduseBER()Set encoding type as BER.voiduseCER()Set encoding type as CER.voiduseDefinitiveLength(boolean isDefinitiveLength) Use definitive length or not.voiduseDER()Set encoding type as DER.voiduseImplicit(boolean isImplicit) Use implicit or not.voidusePrimitive(boolean isPrimitive) Use primitive or constructed.Methods inherited from class org.apache.kerby.asn1.type.AbstractAsn1Type
getValue, setValue, toStringMethods inherited from class org.apache.kerby.asn1.type.Asn1Encodeable
decode, decode, encode, encode, encodingHeaderLength, encodingLength, getBodyLength, getHeaderLength, resetBodyLength, taggedDecode, taggedDecode, taggedDecode, taggedEncode, taggedEncode, taggedEncodingLengthMethods inherited from class org.apache.kerby.asn1.type.Asn1Object
isAppSpecific, isCollection, isContextSpecific, isEOC, isNull, isSimple, isTagSpecific, isUniversal, simpleInfo, tagFlags
-
Constructor Details
-
Asn1TaggingCollection
public Asn1TaggingCollection(int taggingTagNo, Asn1FieldInfo[] tags, boolean isAppSpecific, boolean isImplicit)
-
-
Method Details
-
createTaggedCollection
-
tag
- Specified by:
tagin interfaceAsn1Type- Overrides:
tagin classAsn1Object- Returns:
- The tag
-
tagNo
public int tagNo()- Overrides:
tagNoin classAsn1Object
-
usePrimitive
public void usePrimitive(boolean isPrimitive) Description copied from interface:Asn1TypeUse primitive or constructed.- Specified by:
usePrimitivein interfaceAsn1Type- Overrides:
usePrimitivein classAsn1Encodeable
-
isPrimitive
public boolean isPrimitive()Description copied from interface:Asn1TypeTells if it is PRIMITIVE or not.- Specified by:
isPrimitivein interfaceAsn1Type- Overrides:
isPrimitivein classAsn1Encodeable- Returns:
- true if using PRIMITIVE, false otherwise
-
useDefinitiveLength
public void useDefinitiveLength(boolean isDefinitiveLength) Description copied from interface:Asn1TypeUse definitive length or not. Note definitive length only makes sense when it's constructed.- Specified by:
useDefinitiveLengthin interfaceAsn1Type- Overrides:
useDefinitiveLengthin classAsn1Encodeable
-
isDefinitiveLength
public boolean isDefinitiveLength()Description copied from interface:Asn1TypeTells if it's definitive length or not.- Specified by:
isDefinitiveLengthin interfaceAsn1Type- Overrides:
isDefinitiveLengthin classAsn1Encodeable- Returns:
- The boolean value
-
useImplicit
public void useImplicit(boolean isImplicit) Description copied from interface:Asn1TypeUse implicit or not.- Specified by:
useImplicitin interfaceAsn1Type- Overrides:
useImplicitin classAsn1Encodeable
-
isImplicit
public boolean isImplicit()Description copied from interface:Asn1TypeTells if it's is IMPLICIT or not.- Specified by:
isImplicitin interfaceAsn1Type- Overrides:
isImplicitin classAsn1Encodeable- Returns:
- true if using IMPLICIT, false otherwise
-
useDER
public void useDER()Description copied from interface:Asn1TypeSet encoding type as DER.- Specified by:
useDERin interfaceAsn1Type- Overrides:
useDERin classAsn1Encodeable
-
isDER
public boolean isDER()Description copied from interface:Asn1TypeTells if it's is DER- Specified by:
isDERin interfaceAsn1Type- Overrides:
isDERin classAsn1Encodeable- Returns:
- true if using DER, false otherwise
-
useBER
public void useBER()Description copied from interface:Asn1TypeSet encoding type as BER.- Specified by:
useBERin interfaceAsn1Type- Overrides:
useBERin classAsn1Encodeable
-
isBER
public boolean isBER()Description copied from interface:Asn1TypeTells if it's is BER- Specified by:
isBERin interfaceAsn1Type- Overrides:
isBERin classAsn1Encodeable- Returns:
- true if using BER, false otherwise
-
useCER
public void useCER()Description copied from interface:Asn1TypeSet encoding type as CER.- Specified by:
useCERin interfaceAsn1Type- Overrides:
useCERin classAsn1Encodeable
-
isCER
public boolean isCER()Description copied from interface:Asn1TypeTells if it's is CER- Specified by:
isCERin interfaceAsn1Type- Overrides:
isCERin classAsn1Encodeable- Returns:
- true if using CER, false otherwise
-
encodingBodyLength
- Specified by:
encodingBodyLengthin classAsn1Encodeable- Throws:
IOException
-
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
-
decodeBody
- Specified by:
decodeBodyin classAsn1Encodeable- Throws:
IOException
-
getFieldAs
-
setFieldAs
-
getFieldAsString
-
getFieldAsOctets
-
setFieldAsOctets
-
getFieldAsInteger
-
setFieldAsInt
-
getFieldAsOctetBytes
-
setFieldAsOctetBytes
-
dumpWith
- Specified by:
dumpWithin interfaceAsn1Dumpable
-