Package org.apache.kerby.asn1.type
Class Asn1Simple<T>
java.lang.Object
org.apache.kerby.asn1.type.Asn1Object
org.apache.kerby.asn1.type.Asn1Encodeable
org.apache.kerby.asn1.type.AbstractAsn1Type<T>
org.apache.kerby.asn1.type.Asn1Simple<T>
- All Implemented Interfaces:
Asn1Type
- Direct Known Subclasses:
Asn1BitString,Asn1BmpString,Asn1Boolean,Asn1Enumerated,Asn1Eoc,Asn1GeneralizedTime,Asn1Integer,Asn1IntegerEnumerated,Asn1Null,Asn1ObjectIdentifier,Asn1OctetString,Asn1String,Asn1UtcTime
ASN1 simple type, of single value other than complex type of multiple values.
-
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
ConstructorsConstructorDescriptionAsn1Simple(UniversalTag tagNo) Default constructor, generally for decoding as a value containerAsn1Simple(UniversalTag universalTag, T value) Constructor with a value, generally for encoding of the value -
Method Summary
Modifier and TypeMethodDescriptionstatic Asn1Simple<?>createSimple(int tagNo) Create a simple ASN1 object given tagNo, using the default constructor with no value providedstatic Asn1Simple<?>createSimple(UniversalTag tagNo) Create a simple ASN1 object given tagNo, using the default constructor with no value providedprotected voiddecodeBody(Asn1ParseResult parseResult) protected byte[]protected voidencodeBody(ByteBuffer buffer) protected intprotected byte[]getBytes()booleanTells if it's definitive length or not.static booleanisSimple(int tag) static booleanstatic booleanisSimple(UniversalTag tagNo) protected voidsetBytes(byte[] bytes) protected voidtoBytes()toString()protected voidtoValue()Methods inherited from class org.apache.kerby.asn1.type.AbstractAsn1Type
getValue, setValueMethods inherited from class org.apache.kerby.asn1.type.Asn1Encodeable
decode, decode, decode, encode, encode, encodingHeaderLength, encodingLength, getBodyLength, getHeaderLength, isBER, isCER, 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, tag, tagFlags, tagNo
-
Constructor Details
-
Asn1Simple
Default constructor, generally for decoding as a value container- Parameters:
tagNo- The tag number
-
Asn1Simple
Constructor with a value, generally for encoding of the value- Parameters:
universalTag- The tag numbervalue- The value
-
-
Method Details
-
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
-
getBytes
protected byte[] getBytes() -
setBytes
protected void setBytes(byte[] bytes) -
encodeBody
protected byte[] encodeBody() -
encodeBody
- Overrides:
encodeBodyin classAsn1Encodeable
-
encodingBodyLength
protected int encodingBodyLength()- Specified by:
encodingBodyLengthin classAsn1Encodeable
-
decodeBody
- Specified by:
decodeBodyin classAsn1Encodeable- Throws:
IOException
-
toValue
- Throws:
IOException
-
toBytes
protected void toBytes() -
isSimple
-
isSimple
public static boolean isSimple(int tag) -
isSimple
-
createSimple
Create a simple ASN1 object given tagNo, using the default constructor with no value provided- Parameters:
tagNo- The tag number- Returns:
- A simple ASN1 object
-
createSimple
Create a simple ASN1 object given tagNo, using the default constructor with no value provided- Parameters:
tagNo- The tag number- Returns:
- The simple ASN1 object
-
toString
- Overrides:
toStringin classAbstractAsn1Type<T>
-