public abstract class Asn1Encodeable extends Asn1Object implements Asn1Type
Asn1Type.EncodingType| Modifier and Type | Field and Description |
|---|---|
protected int |
bodyLength |
Asn1Encodeable |
outerEncodeable |
| Constructor and Description |
|---|
Asn1Encodeable(int tag)
Constructor with a tag
|
Asn1Encodeable(Tag tag)
Constructor with a tag
|
Asn1Encodeable(UniversalTag tag)
Default constructor with an universal tag.
|
| Modifier and Type | Method and Description |
|---|---|
void |
decode(Asn1ParseResult parseResult) |
void |
decode(byte[] content)
Decode the content bytes into this type.
|
void |
decode(ByteBuffer content)
Decode the content bytes into this type.
|
protected abstract void |
decodeBody(Asn1ParseResult parseResult) |
byte[] |
encode()
Encode the type, by recursively.
|
void |
encode(ByteBuffer buffer)
Encode the type, by recursively, using the provided buffer.
|
protected void |
encodeBody(ByteBuffer buffer) |
protected abstract int |
encodingBodyLength() |
protected int |
encodingHeaderLength() |
int |
encodingLength()
Get length of encoding bytes by just calculating without real encoding.
|
protected int |
getBodyLength() |
protected int |
getHeaderLength() |
boolean |
isBER()
Tells if it's is BER
|
boolean |
isCER()
Tells if it's is CER
|
boolean |
isDefinitiveLength()
Tells if it's definitive length or not.
|
boolean |
isDER()
Tells if it's is DER
|
boolean |
isImplicit()
Tells if it's is IMPLICIT or not.
|
boolean |
isPrimitive()
Tells if it is PRIMITIVE or not.
|
void |
resetBodyLength() |
void |
taggedDecode(Asn1ParseResult parseResult,
TaggingOption taggingOption) |
void |
taggedDecode(byte[] content,
TaggingOption taggingOption)
Decode the content bytes into this type as it's tagged with the provided
tagging option.
|
void |
taggedDecode(ByteBuffer content,
TaggingOption taggingOption)
Decode the content bytes into this type as it's tagged with the provided
tagging option.
|
void |
taggedEncode(ByteBuffer buffer,
TaggingOption taggingOption)
Tag and encode this type using the provided tagging option.
|
byte[] |
taggedEncode(TaggingOption taggingOption)
Tag and encode this type using the provided tagging option.
|
protected int |
taggedEncodingLength(TaggingOption taggingOption) |
void |
useBER()
Set encoding type as BER.
|
void |
useCER()
Set encoding type as CER.
|
void |
useDefinitiveLength(boolean isDefinitiveLength)
Use definitive length or not.
|
void |
useDER()
Set encoding type as DER.
|
void |
useImplicit(boolean isImplicit)
Use implicit or not.
|
void |
usePrimitive(boolean isPrimitive)
Use primitive or constructed.
|
isAppSpecific, isCollection, isContextSpecific, isEOC, isNull, isSimple, isTagSpecific, isUniversal, simpleInfo, tag, tagFlags, tagNoprotected int bodyLength
public Asn1Encodeable outerEncodeable
public Asn1Encodeable(Tag tag)
tag - The tagpublic Asn1Encodeable(UniversalTag tag)
tag - the tagpublic Asn1Encodeable(int tag)
tag - The tagpublic void usePrimitive(boolean isPrimitive)
Asn1TypeusePrimitive in interface Asn1TypeusePrimitive in class Asn1Objectpublic boolean isPrimitive()
Asn1TypeisPrimitive in interface Asn1TypeisPrimitive in class Asn1Objectpublic void useDefinitiveLength(boolean isDefinitiveLength)
Asn1TypeuseDefinitiveLength in interface Asn1Typepublic boolean isDefinitiveLength()
Asn1TypeisDefinitiveLength in interface Asn1Typepublic void useImplicit(boolean isImplicit)
Asn1TypeuseImplicit in interface Asn1Typepublic boolean isImplicit()
Asn1TypeisImplicit in interface Asn1Typepublic void useDER()
Asn1Typepublic boolean isDER()
Asn1Typepublic void useBER()
Asn1Typepublic boolean isBER()
Asn1Typepublic void useCER()
Asn1Typepublic boolean isCER()
Asn1Typepublic byte[] encode()
throws IOException
Asn1Typeencode in interface Asn1TypeIOExceptionpublic void encode(ByteBuffer buffer) throws IOException
Asn1Typeencode in interface Asn1Typebuffer - The byte bufferIOExceptionpublic void resetBodyLength()
protected void encodeBody(ByteBuffer buffer) throws IOException
IOExceptionpublic void decode(byte[] content)
throws IOException
Asn1Typedecode in interface Asn1Typecontent - The content bytesIOException - epublic int encodingLength()
Asn1TypeencodingLength in interface Asn1Typeprotected int getHeaderLength()
getHeaderLength in class Asn1Objectprotected int getBodyLength()
getBodyLength in class Asn1Objectprotected int encodingHeaderLength()
throws IOException
IOExceptionprotected abstract int encodingBodyLength()
throws IOException
IOExceptionpublic void decode(ByteBuffer content) throws IOException
Asn1Typedecode in interface Asn1Typecontent - The content bytesIOException - epublic void decode(Asn1ParseResult parseResult) throws IOException
IOExceptionprotected abstract void decodeBody(Asn1ParseResult parseResult) throws IOException
IOExceptionprotected int taggedEncodingLength(TaggingOption taggingOption)
public byte[] taggedEncode(TaggingOption taggingOption) throws IOException
Asn1TypetaggedEncode in interface Asn1TypetaggingOption - The tagging optionIOExceptionpublic void taggedEncode(ByteBuffer buffer, TaggingOption taggingOption) throws IOException
Asn1TypetaggedEncode in interface Asn1Typebuffer - The byte buffertaggingOption - The tagging optionIOExceptionpublic void taggedDecode(byte[] content,
TaggingOption taggingOption)
throws IOException
Asn1TypeTaggingOptiontaggedDecode in interface Asn1Typecontent - The content bytestaggingOption - The tagging optionIOException - epublic void taggedDecode(ByteBuffer content, TaggingOption taggingOption) throws IOException
Asn1TypeTaggingOptiontaggedDecode in interface Asn1Typecontent - The content bytestaggingOption - The tagging optionIOException - epublic void taggedDecode(Asn1ParseResult parseResult, TaggingOption taggingOption) throws IOException
IOExceptionCopyright © 2014–2017 The Apache Software Foundation. All rights reserved.