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 final int | |
| private static final int | |
| private final ASN1OctetString[] |
| 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. octs)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. chunkSize)Create an OCTET-STRING object from a byte[] |
| public | BEROctetString(ASN1OctetString[]
an array of OCTET STRING to construct the BER OCTET STRING from. octs, int the number of octets stored in each DER encoded component OCTET STRING. chunkSize)Multiple |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| pack-priv int | encodedLength()
Implements abstract org. |
| pack-priv static BEROctetString | |
| private Vector | |
| public Enumeration | Returns: an Enumeration of the component OCTET STRINGs.Return the OCTET STRINGs that make up this string. |
| public byte[] | Returns: the full OCTET STRING. |
| pack-priv boolean | isConstructed()
Implements abstract org. |
| private static byte[] |
| chunkSize | back to summary |
|---|---|
| private final int chunkSize | |
| DEFAULT_LENGTH | back to summary |
|---|---|
| private static final int DEFAULT_LENGTH | |
| octs | back to summary |
|---|---|
| private final ASN1OctetString[] octs | |
| BEROctetString | back to summary |
|---|---|
| public BEROctetString(byte[] string) Create an OCTET-STRING object from a byte[]
| |
| BEROctetString | back to summary |
|---|---|
| public BEROctetString(ASN1OctetString[] octs) Multiple
| |
| BEROctetString | back to summary |
|---|---|
| public BEROctetString(byte[] string, int chunkSize) Create an OCTET-STRING object from a byte[]
| |
| BEROctetString | back to summary |
|---|---|
| public BEROctetString(ASN1OctetString[] octs, int chunkSize) Multiple
| |
| BEROctetString | back to summary |
|---|---|
| private BEROctetString(byte[] string, ASN1OctetString[] octs, int chunkSize) | |
| encode | back to summary |
|---|---|
| public void encode(ASN1OutputStream out) throws IOException Implements abstract org. | |
| encodedLength | back to summary |
|---|---|
| pack-priv int encodedLength() throws IOException Implements abstract org. Doc from org. Return the length of the encoding this object will produce.
| |
| fromSequence | back to summary |
|---|---|
| pack-priv static BEROctetString fromSequence(ASN1Sequence seq) | |
| generateOcts | back to summary |
|---|---|
| private Vector | |
| getObjects | back to summary |
|---|---|
| public Enumeration Return the OCTET STRINGs that make up this string.
| |
| getOctets | back to summary |
|---|---|
| public byte[] getOctets() Overrides org. Return a concatenated byte array of all the octets making up the constructed OCTET STRING
| |
| isConstructed | back to summary |
|---|---|
| pack-priv boolean isConstructed() Implements abstract org. Doc from org. Return true if this objected is a CONSTRUCTED one, false otherwise.
| |
| toBytes | back to summary |
|---|---|
| private static byte[] toBytes(ASN1OctetString[] octs) Convert a vector of octet strings into a single byte string | |