Class Extension

    • Constructor Detail

      • Extension

        public Extension​(ASN1ObjectIdentifier extnId,
                         ASN1Boolean critical,
                         ASN1OctetString value)
        Constructor using an ASN1Boolean and an OCTET STRING for the value.
        Parameters:
        extnId - the OID associated with this extension.
        critical - will evaluate to true if the extension is critical, false otherwise.
        value - the extension's value wrapped in an OCTET STRING.
      • Extension

        public Extension​(ASN1ObjectIdentifier extnId,
                         boolean critical,
                         byte[] value)
        Constructor using a byte[] for the value.
        Parameters:
        extnId - the OID associated with this extension.
        critical - true if the extension is critical, false otherwise.
        value - the extension's value as a byte[] to be wrapped in an OCTET STRING.
      • Extension

        public Extension​(ASN1ObjectIdentifier extnId,
                         boolean critical,
                         ASN1OctetString value)
        Constructor using an OCTET STRING for the value.
        Parameters:
        extnId - the OID associated with this extension.
        critical - true if the extension is critical, false otherwise.
        value - the extension's value wrapped in an OCTET STRING.
    • Method Detail

      • create

        public static Extension create​(ASN1ObjectIdentifier extnId,
                                       boolean critical,
                                       ASN1Encodable value)
                                throws java.io.IOException
        Helper method to create an extension from any ASN.1 encodable object.
        Parameters:
        extnId - the OID associated with this extension.
        critical - true if the extension is critical, false otherwise.
        value - the value to be encoded into the extension's OCTET STRING.
        Returns:
        a new Extension with the encoding of value in the bytes of the extension's OCTET STRING.
        Throws:
        java.io.IOException - if the value cannot be encoded into bytes.
      • getInstance

        public static Extension getInstance​(java.lang.Object obj)
      • isCritical

        public boolean isCritical()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class ASN1Object