public final class Asn1 extends Object
Asn1Reader
,
Asn1Writer
Modifier and Type | Field and Description |
---|---|
static byte |
BOOLEAN_VALUE_FALSE
The byte array containing the pre-encoded ASN.1 encoding for a boolean value of "false".
|
static byte |
BOOLEAN_VALUE_TRUE
The byte array containing the pre-encoded ASN.1 encoding for a boolean value of "false".
|
static int |
ELEMENT_READ_STATE_NEED_ADDITIONAL_LENGTH_BYTES
The ASN.1 element decoding state that indicates that the next byte read
should be additional bytes of a multi-byte length.
|
static int |
ELEMENT_READ_STATE_NEED_FIRST_LENGTH_BYTE
The ASN.1 element decoding state that indicates that the next byte read
should be the first byte for the element length.
|
static int |
ELEMENT_READ_STATE_NEED_TYPE
The ASN.1 element decoding state that indicates that the next byte read
should be the BER type for a new element.
|
static int |
ELEMENT_READ_STATE_NEED_VALUE_BYTES
The ASN.1 element decoding state that indicates that the next byte read
should be applied to the value of the element.
|
static byte |
TYPE_MASK_CONSTRUCTED
The bitmask that can be ANDed with the BER type to determine if the
element is constructed.
|
static byte |
TYPE_MASK_CONTEXT
The bitmask that can be ANDed with the BER type to determine if the
element is in the context-specific class.
|
static byte |
UNIVERSAL_BIT_STRING_TYPE
The BER type that is assigned to the universal bit string type.
|
static byte |
UNIVERSAL_BOOLEAN_TYPE
The BER type that is assigned to the universal Boolean element.
|
static byte |
UNIVERSAL_ENUMERATED_TYPE
The BER type that is assigned to the universal enumerated type.
|
static byte |
UNIVERSAL_INTEGER_TYPE
The BER type that is assigned to the universal integer type.
|
static byte |
UNIVERSAL_NULL_TYPE
The BER type that is assigned to the universal null type.
|
static byte |
UNIVERSAL_OCTET_STRING_TYPE
The BER type that is assigned to the universal octet string type.
|
static byte |
UNIVERSAL_PRINTABLE_STRING_TYPE
The BER type that is assigned to the universal Printable String type.
|
static byte |
UNIVERSAL_SEQUENCE_TYPE
The BER type that is assigned to the universal sequence type.
|
static byte |
UNIVERSAL_SET_TYPE
The BER type that is assigned to the universal set type.
|
Modifier and Type | Method and Description |
---|---|
static Asn1Reader |
getReader(byte[] array)
Returns an ASN.1 reader whose source is the provided byte array and
having an unlimited maximum BER element size.
|
static Asn1Reader |
getReader(byte[] array,
int maxElementSize)
Returns an ASN.1 reader whose source is the provided byte array and
having a user defined maximum BER element size.
|
static Asn1Reader |
getReader(ByteSequence sequence)
Returns an ASN.1 reader whose source is the provided byte sequence and
having an unlimited maximum BER element size.
|
static Asn1Reader |
getReader(ByteSequence sequence,
int maxElementSize)
Returns an ASN.1 reader whose source is the provided byte sequence and
having a user defined maximum BER element size.
|
static Asn1Reader |
getReader(ByteSequenceReader reader)
Returns an ASN.1 reader whose source is the provided byte sequence reader
and having an unlimited maximum BER element size.
|
static Asn1Reader |
getReader(ByteSequenceReader reader,
int maxElementSize)
Returns an ASN.1 reader whose source is the provided byte sequence reader
and having a user defined maximum BER element size.
|
static Asn1Reader |
getReader(InputStream stream)
Returns an ASN.1 reader whose source is the provided input stream and
having an unlimited maximum BER element size.
|
static Asn1Reader |
getReader(InputStream stream,
int maxElementSize)
Returns an ASN.1 reader whose source is the provided input stream and
having a user defined maximum BER element size.
|
static Asn1Writer |
getWriter(ByteStringBuilder builder)
Returns an ASN.1 writer whose destination is the provided byte string
builder.
|
static Asn1Writer |
getWriter(ByteStringBuilder builder,
int maxBufferSize)
Returns an ASN.1 writer whose destination is the provided byte string
builder.
|
static Asn1Writer |
getWriter(OutputStream stream)
Returns an ASN.1 writer whose destination is the provided output stream.
|
static Asn1Writer |
getWriter(OutputStream stream,
int maxBufferSize)
Returns an ASN.1 writer whose destination is the provided output stream.
|
public static final byte BOOLEAN_VALUE_FALSE
public static final byte BOOLEAN_VALUE_TRUE
public static final byte UNIVERSAL_BOOLEAN_TYPE
public static final byte UNIVERSAL_INTEGER_TYPE
public static final byte UNIVERSAL_BIT_STRING_TYPE
public static final byte UNIVERSAL_OCTET_STRING_TYPE
public static final byte UNIVERSAL_NULL_TYPE
public static final byte UNIVERSAL_PRINTABLE_STRING_TYPE
public static final byte UNIVERSAL_ENUMERATED_TYPE
public static final byte UNIVERSAL_SEQUENCE_TYPE
public static final byte UNIVERSAL_SET_TYPE
public static final int ELEMENT_READ_STATE_NEED_ADDITIONAL_LENGTH_BYTES
public static final int ELEMENT_READ_STATE_NEED_FIRST_LENGTH_BYTE
public static final int ELEMENT_READ_STATE_NEED_TYPE
public static final int ELEMENT_READ_STATE_NEED_VALUE_BYTES
public static final byte TYPE_MASK_CONSTRUCTED
public static final byte TYPE_MASK_CONTEXT
public static Asn1Reader getReader(byte[] array)
array
- The byte array to use.public static Asn1Reader getReader(byte[] array, int maxElementSize)
array
- The byte array to use.maxElementSize
- The maximum BER element size, or 0
to indicate that
there is no limit.public static Asn1Reader getReader(ByteSequence sequence)
sequence
- The byte sequence to use.public static Asn1Reader getReader(ByteSequence sequence, int maxElementSize)
sequence
- The byte sequence to use.maxElementSize
- The maximum BER element size, or 0
to indicate that
there is no limit.public static Asn1Reader getReader(ByteSequenceReader reader)
reader
- The byte sequence reader to use.public static Asn1Reader getReader(ByteSequenceReader reader, int maxElementSize)
reader
- The byte sequence reader to use.maxElementSize
- The maximum BER element size, or 0
to indicate that
there is no limit.public static Asn1Reader getReader(InputStream stream)
stream
- The input stream to use.public static Asn1Reader getReader(InputStream stream, int maxElementSize)
stream
- The input stream to use.maxElementSize
- The maximum BER element size, or 0
to indicate that
there is no limit.public static Asn1Writer getWriter(ByteStringBuilder builder)
builder
- The byte string builder to use.public static Asn1Writer getWriter(ByteStringBuilder builder, int maxBufferSize)
builder
- The output stream to use.maxBufferSize
- The threshold capacity beyond which internal cached buffers used
for encoding and decoding ASN1 will be trimmed after use.public static Asn1Writer getWriter(OutputStream stream)
stream
- The output stream to use.public static Asn1Writer getWriter(OutputStream stream, int maxBufferSize)
stream
- The output stream to use.maxBufferSize
- The threshold capacity beyond which internal cached buffers used
for encoding and decoding ASN1 will be trimmed after use.Copyright © 2010-2018, ForgeRock All Rights Reserved.