ASN1Encodable
, ASN1OctetStringParser
, InMemoryRepresentable
, Encodable
BERConstructedOctetString
public class BEROctetString extends ASN1OctetString
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.
Constructor | Description |
---|---|
BEROctetString(byte[] string) |
Create an OCTET-STRING object from a byte[]
|
BEROctetString(byte[] string,
int chunkSize) |
Create an OCTET-STRING object from a byte[]
|
BEROctetString(ASN1OctetString[] octs) |
Multiple
ASN1OctetString data blocks are input,
the result is constructed form. |
BEROctetString(ASN1OctetString[] octs,
int chunkSize) |
Multiple
ASN1OctetString data blocks are input,
the result is constructed form. |
Modifier and Type | Method | Description |
---|---|---|
void |
encode(ASN1OutputStream out) |
|
java.util.Enumeration |
getObjects() |
Return the OCTET STRINGs that make up this string.
|
byte[] |
getOctets() |
Return a concatenated byte array of all the octets making up the constructed OCTET STRING
|
toASN1Primitive
getEncoded, getEncoded, hasEncodedTagValue, toASN1Object
getInstance, getInstance, getLoadedObject, getOctetStream, hashCode, parser, toString
equals, fromByteArray, toASN1Primitive
public BEROctetString(byte[] string)
string
- the octets making up the octet string.public BEROctetString(ASN1OctetString[] octs)
ASN1OctetString
data blocks are input,
the result is constructed form.octs
- an array of OCTET STRING to construct the BER OCTET STRING from.public BEROctetString(byte[] string, int chunkSize)
string
- the octets making up the octet string.chunkSize
- the number of octets stored in each DER encoded component OCTET STRING.public BEROctetString(ASN1OctetString[] octs, int chunkSize)
ASN1OctetString
data blocks are input,
the result is constructed form.octs
- an array of OCTET STRING to construct the BER OCTET STRING from.chunkSize
- the number of octets stored in each DER encoded component OCTET STRING.public byte[] getOctets()
getOctets
in class ASN1OctetString
public java.util.Enumeration getObjects()
public void encode(ASN1OutputStream out) throws java.io.IOException
java.io.IOException