Class Extension

    • Field Detail

      • critical

        protected boolean critical
      • extensionValue

        protected byte[] extensionValue
    • Constructor Detail

      • Extension

        public Extension()
        Default constructor. Used only by sub-classes.
      • Extension

        public Extension​(DerValue derVal)
                  throws java.io.IOException
        Constructs an extension from a DER encoded array of bytes.
        Throws:
        java.io.IOException
      • Extension

        public Extension​(ObjectIdentifier extensionId,
                         boolean critical,
                         byte[] extensionValue)
                  throws java.io.IOException
        Constructs an Extension from individual components of ObjectIdentifier, criticality and the DER encoded OctetString.
        Parameters:
        extensionId - the ObjectIdentifier of the extension
        critical - the boolean indicating if the extension is critical
        extensionValue - the DER encoded octet string of the value.
        Throws:
        java.io.IOException
      • Extension

        public Extension​(Extension ext)
        Constructs an Extension from another extension. To be used for creating decoded subclasses.
        Parameters:
        ext - the extension to create from.
    • Method Detail

      • encode

        public void encode​(DerOutputStream out)
                    throws java.io.IOException
        Write the extension to the DerOutputStream.
        Parameters:
        out - the DerOutputStream to write the extension to.
        Throws:
        java.io.IOException - on encoding errors
      • isCritical

        public boolean isCritical()
        Returns true if extension is critical.
      • setCritical

        public void setCritical​(boolean c)
      • clearValue

        public void clearValue()
      • getExtensionId

        public ObjectIdentifier getExtensionId()
        Returns the ObjectIdentifier of the extension.
      • getExtensionValue

        public byte[] getExtensionValue()
        Returns the extension value as an byte array for further processing. Note, this is the raw DER value of the extension, not the DER encoded octet string which is in the certificate.
      • setExtensionValue

        public void setExtensionValue​(byte[] value)
      • toString

        public java.lang.String toString()
        Returns the Extension in user readable form.
        Overrides:
        toString in class java.lang.Object