The Basic Encoding Rules (BER) format allows encoding using so called "constructed form", which DER and CER formats forbid allowing only "primitive form".
This class always produces the constructed form with underlying segments in an indefinite length array. If the input wasn't the same, then this output is not faithful reproduction.
See ASN1OctetString for X.690 encoding rules of OCTET-STRING objects.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private final ASN1OctetString[] | |
| private final int |
| Access | Constructor and Description |
|---|---|
| public | BEROctetString(byte[]
the octets making up the octet string. string)Create an OCTET-STRING object from a byte[] |
| public | BEROctetString(ASN1OctetString[]
an array of OCTET STRING to construct the BER OCTET STRING from. elements)Multiple |
| public | BEROctetString(byte[]
the octets making up the octet string. string, int the number of octets stored in each DER encoded component OCTET STRING. segmentLimit)Create an OCTET-STRING object from a byte[] |
| public | BEROctetString(ASN1OctetString[]
an array of OCTET STRING to construct the BER OCTET STRING from. elements, int the number of octets stored in each DER encoded component OCTET STRING. segmentLimit)Multiple |
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | encode(ASN1OutputStream out, boolean withTag)
Implements abstract org. |
| pack-priv boolean | encodeConstructed()
Implements abstract org. |
| pack-priv int | encodedLength(boolean withTag)
Implements abstract org. |
| pack-priv static byte[] | flattenOctetStrings(ASN1OctetString[] octetStrings)
Convert a vector of octet strings into a single byte string |
| DEFAULT_SEGMENT_LIMIT | back to summary |
|---|---|
| private static final int DEFAULT_SEGMENT_LIMIT | |
| elements | back to summary |
|---|---|
| private final ASN1OctetString[] elements | |
| segmentLimit | back to summary |
|---|---|
| private final int segmentLimit | |
| BEROctetString | back to summary |
|---|---|
| public BEROctetString(byte[] string) Create an OCTET-STRING object from a byte[]
| |
| BEROctetString | back to summary |
|---|---|
| public BEROctetString(ASN1OctetString[] elements) Multiple
| |
| BEROctetString | back to summary |
|---|---|
| public BEROctetString(byte[] string, int segmentLimit) Create an OCTET-STRING object from a byte[]
| |
| BEROctetString | back to summary |
|---|---|
| public BEROctetString(ASN1OctetString[] elements, int segmentLimit) Multiple
| |
| BEROctetString | back to summary |
|---|---|
| private BEROctetString(byte[] string, ASN1OctetString[] elements, int segmentLimit) | |
| encode | back to summary |
|---|---|
| pack-priv void encode(ASN1OutputStream out, boolean withTag) throws IOException Implements abstract org. | |
| encodeConstructed | back to summary |
|---|---|
| pack-priv boolean encodeConstructed() Implements abstract org. Doc from org. Return true if this objected is a CONSTRUCTED one, false otherwise.
| |
| encodedLength | back to summary |
|---|---|
| pack-priv int encodedLength(boolean withTag) throws IOException Implements abstract org. | |
| flattenOctetStrings | back to summary |
|---|---|
| pack-priv static byte[] flattenOctetStrings(ASN1OctetString[] octetStrings) Convert a vector of octet strings into a single byte string | |