Package org.forgerock.opendj.io
Class ASN1
java.lang.Object
org.forgerock.opendj.io.ASN1
This class contains various static factory methods for creating ASN.1 readers
and writers.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteThe byte array containing the pre-encoded ASN.1 encoding for a boolean value of "false".static final byteThe byte array containing the pre-encoded ASN.1 encoding for a boolean value of "false".static final intThe ASN.1 element decoding state that indicates that the next byte read should be additional bytes of a multi-byte length.static final intThe ASN.1 element decoding state that indicates that the next byte read should be the first byte for the element length.static final intThe ASN.1 element decoding state that indicates that the next byte read should be the BER type for a new element.static final intThe ASN.1 element decoding state that indicates that the next byte read should be applied to the value of the element.static final byteThe bitmask that can be ANDed with the BER type to determine if the element is constructed.static final byteThe bitmask that can be ANDed with the BER type to determine if the element is in the context-specific class.static final byteThe BER type that is assigned to the universal bit string type.static final byteThe BER type that is assigned to the universal Boolean element.static final byteThe BER type that is assigned to the universal enumerated type.static final byteThe BER type that is assigned to the universal integer type.static final byteThe BER type that is assigned to the universal null type.static final byteThe BER type that is assigned to the universal octet string type.static final byteThe BER type that is assigned to the universal sequence type.static final byteThe BER type that is assigned to the universal set type. -
Method Summary
Modifier and TypeMethodDescriptionstatic ASN1ReadergetReader(byte[] array) Returns an ASN.1 reader whose source is the provided byte array and having an unlimited maximum BER element size.static ASN1ReadergetReader(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 ASN1ReadergetReader(InputStream stream) Returns an ASN.1 reader whose source is the provided input stream and having an unlimited maximum BER element size.static ASN1ReadergetReader(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 ASN1ReadergetReader(ByteSequence sequence) Returns an ASN.1 reader whose source is the provided byte sequence and having an unlimited maximum BER element size.static ASN1ReadergetReader(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 ASN1ReadergetReader(ByteSequenceReader reader) Returns an ASN.1 reader whose source is the provided byte sequence reader and having an unlimited maximum BER element size.static ASN1ReadergetReader(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 ASN1WritergetWriter(OutputStream stream) Returns an ASN.1 writer whose destination is the provided output stream.static ASN1WritergetWriter(OutputStream stream, int maxBufferSize) Returns an ASN.1 writer whose destination is the provided output stream.static ASN1WritergetWriter(ByteStringBuilder builder) Returns an ASN.1 writer whose destination is the provided byte string builder.static ASN1WritergetWriter(ByteStringBuilder builder, int maxBufferSize) Returns an ASN.1 writer whose destination is the provided byte string builder.
-
Field Details
-
BOOLEAN_VALUE_FALSE
The byte array containing the pre-encoded ASN.1 encoding for a boolean value of "false".- See Also:
-
BOOLEAN_VALUE_TRUE
The byte array containing the pre-encoded ASN.1 encoding for a boolean value of "false".- See Also:
-
UNIVERSAL_BOOLEAN_TYPE
The BER type that is assigned to the universal Boolean element.- See Also:
-
UNIVERSAL_INTEGER_TYPE
The BER type that is assigned to the universal integer type.- See Also:
-
UNIVERSAL_BIT_STRING_TYPE
The BER type that is assigned to the universal bit string type.- See Also:
-
UNIVERSAL_OCTET_STRING_TYPE
The BER type that is assigned to the universal octet string type.- See Also:
-
UNIVERSAL_NULL_TYPE
The BER type that is assigned to the universal null type.- See Also:
-
UNIVERSAL_ENUMERATED_TYPE
The BER type that is assigned to the universal enumerated type.- See Also:
-
UNIVERSAL_SEQUENCE_TYPE
The BER type that is assigned to the universal sequence type.- See Also:
-
UNIVERSAL_SET_TYPE
The BER type that is assigned to the universal set type.- See Also:
-
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.- See Also:
-
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.- See Also:
-
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.- See Also:
-
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.- See Also:
-
TYPE_MASK_CONSTRUCTED
The bitmask that can be ANDed with the BER type to determine if the element is constructed.- See Also:
-
TYPE_MASK_CONTEXT
The bitmask that can be ANDed with the BER type to determine if the element is in the context-specific class.- See Also:
-
-
Method Details
-
getReader
Returns an ASN.1 reader whose source is the provided byte array and having an unlimited maximum BER element size.- Parameters:
array- The byte array to use.- Returns:
- The new ASN.1 reader.
-
getReader
Returns an ASN.1 reader whose source is the provided byte array and having a user defined maximum BER element size.- Parameters:
array- The byte array to use.maxElementSize- The maximum BER element size, or0to indicate that there is no limit.- Returns:
- The new ASN.1 reader.
-
getReader
Returns an ASN.1 reader whose source is the provided byte sequence and having an unlimited maximum BER element size.- Parameters:
sequence- The byte sequence to use.- Returns:
- The new ASN.1 reader.
-
getReader
Returns an ASN.1 reader whose source is the provided byte sequence and having a user defined maximum BER element size.- Parameters:
sequence- The byte sequence to use.maxElementSize- The maximum BER element size, or0to indicate that there is no limit.- Returns:
- The new ASN.1 reader.
-
getReader
Returns an ASN.1 reader whose source is the provided byte sequence reader and having an unlimited maximum BER element size.- Parameters:
reader- The byte sequence reader to use.- Returns:
- The new ASN.1 reader.
-
getReader
Returns an ASN.1 reader whose source is the provided byte sequence reader and having a user defined maximum BER element size.- Parameters:
reader- The byte sequence reader to use.maxElementSize- The maximum BER element size, or0to indicate that there is no limit.- Returns:
- The new ASN.1 reader.
-
getReader
Returns an ASN.1 reader whose source is the provided input stream and having an unlimited maximum BER element size.- Parameters:
stream- The input stream to use.- Returns:
- The new ASN.1 reader.
-
getReader
Returns an ASN.1 reader whose source is the provided input stream and having a user defined maximum BER element size.- Parameters:
stream- The input stream to use.maxElementSize- The maximum BER element size, or0to indicate that there is no limit.- Returns:
- The new ASN.1 reader.
-
getWriter
Returns an ASN.1 writer whose destination is the provided byte string builder.- Parameters:
builder- The byte string builder to use.- Returns:
- The new ASN.1 writer.
-
getWriter
Returns an ASN.1 writer whose destination is the provided byte string builder.- Parameters:
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.- Returns:
- The new ASN.1 writer.
-
getWriter
Returns an ASN.1 writer whose destination is the provided output stream.- Parameters:
stream- The output stream to use.- Returns:
- The new ASN.1 writer.
-
getWriter
Returns an ASN.1 writer whose destination is the provided output stream.- Parameters:
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.- Returns:
- The new ASN.1 writer.
-