Package org.bouncycastle.asn1
Class BEROctetString
- java.lang.Object
-
- org.bouncycastle.asn1.ASN1Object
-
- org.bouncycastle.asn1.ASN1Primitive
-
- org.bouncycastle.asn1.ASN1OctetString
-
- org.bouncycastle.asn1.BEROctetString
-
- All Implemented Interfaces:
ASN1Encodable,ASN1OctetStringParser,InMemoryRepresentable,Encodable
public class BEROctetString extends ASN1OctetString
ASN.1 OctetStrings, with indefinite length rules, and constructed form support.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
ASN1OctetStringfor X.690 encoding rules of OCTET-STRING objects.
-
-
Field Summary
Fields Modifier and Type Field Description static BEROctetStringEMPTY
-
Constructor Summary
Constructors Constructor Description BEROctetString(byte[] string)Create an OCTET-STRING object from a byte[]BEROctetString(byte[] string, int segmentLimit)Create an OCTET-STRING object from a byte[]BEROctetString(ASN1OctetString[] elements)MultipleASN1OctetStringdata blocks are input, the result is constructed form.BEROctetString(ASN1OctetString[] elements, int segmentLimit)MultipleASN1OctetStringdata blocks are input, the result is constructed form.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BEROctetStringfromContents(byte[] contents)static BEROctetStringfromContentsOptional(byte[] contents)static BEROctetStringwithContents(byte[] contents)static BEROctetStringwithContentsOptional(byte[] contents)-
Methods inherited from class org.bouncycastle.asn1.ASN1OctetString
getInstance, getInstance, getLoadedObject, getOctets, getOctetsLength, getOctetStream, getTagged, hashCode, parser, toString
-
Methods inherited from class org.bouncycastle.asn1.ASN1Primitive
encodeTo, encodeTo, equals, equals, equals, fromByteArray, toASN1Primitive
-
Methods inherited from class org.bouncycastle.asn1.ASN1Object
getEncoded, getEncoded, hasEncodedTagValue
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.bouncycastle.asn1.ASN1Encodable
toASN1Primitive
-
-
-
-
Field Detail
-
EMPTY
public static final BEROctetString EMPTY
-
-
Constructor Detail
-
BEROctetString
public BEROctetString(byte[] string)
Create an OCTET-STRING object from a byte[]- Parameters:
string- the octets making up the octet string.
-
BEROctetString
public BEROctetString(ASN1OctetString[] elements)
MultipleASN1OctetStringdata blocks are input, the result is constructed form.- Parameters:
elements- an array of OCTET STRING to construct the BER OCTET STRING from.
-
BEROctetString
public BEROctetString(byte[] string, int segmentLimit)Create an OCTET-STRING object from a byte[]- Parameters:
string- the octets making up the octet string.segmentLimit- the number of octets stored in each DER encoded component OCTET STRING.
-
BEROctetString
public BEROctetString(ASN1OctetString[] elements, int segmentLimit)
MultipleASN1OctetStringdata blocks are input, the result is constructed form.- Parameters:
elements- an array of OCTET STRING to construct the BER OCTET STRING from.segmentLimit- the number of octets stored in each DER encoded component OCTET STRING.
-
-
Method Detail
-
fromContents
public static BEROctetString fromContents(byte[] contents)
-
fromContentsOptional
public static BEROctetString fromContentsOptional(byte[] contents)
-
withContents
public static BEROctetString withContents(byte[] contents)
-
withContentsOptional
public static BEROctetString withContentsOptional(byte[] contents)
-
-