Class BEROctetString

  • All Implemented Interfaces:
    io.anyline.nfc.bouncycastle.asn1.ASN1Encodable , io.anyline.nfc.bouncycastle.asn1.ASN1OctetStringParser , io.anyline.nfc.bouncycastle.asn1.InMemoryRepresentable , io.anyline.nfc.bouncycastle.util.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 ASN1OctetString for X.690 encoding rules of OCTET-STRING objects.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Enumeration getObjects() Return the OCTET STRINGs that make up this string.
      • Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1OctetString

        getInstance, getInstance, getLoadedObject, getOctetStream, getOctets, hashCode, parser, toString
      • Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Primitive

        encodeTo, encodeTo, equals, equals, equals, fromByteArray, toASN1Primitive
      • Methods inherited from class io.anyline.nfc.bouncycastle.asn1.ASN1Object

        equals, getEncoded, getEncoded
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BEROctetString

        BEROctetString(Array<byte> string)
        Create an OCTET-STRING object from a byte[]
        Parameters:
        string - the octets making up the octet string.
      • BEROctetString

        BEROctetString(Array<ASN1OctetString> elements)
        Multiple ASN1OctetString data blocks are input, the result is constructed form.
        Parameters:
        elements - an array of OCTET STRING to construct the BER OCTET STRING from.
      • BEROctetString

        BEROctetString(Array<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

        BEROctetString(Array<ASN1OctetString> elements, int segmentLimit)
        Multiple ASN1OctetString data 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

      • getObjects

         Enumeration getObjects()

        Return the OCTET STRINGs that make up this string.

        Returns:

        an Enumeration of the component OCTET STRINGs.