Class X509Extension

  • Direct Known Subclasses:
    BouncyCastleX509Extension

    public class X509Extension
    extends java.lang.Object
    Represents an X.509 extension. It is used to create X.509 extensions and pass them in a map during certificate generation.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean critical  
      private static I18n i18n  
      protected java.lang.String oid  
      protected byte[] value  
    • Constructor Summary

      Constructors 
      Constructor Description
      X509Extension​(java.lang.String oid)
      Creates a X509Extension object with specified oid.
      X509Extension​(java.lang.String oid, boolean critical, byte[] value)
      Creates a X509Extension object with specified oid, critical property, and value.
      X509Extension​(java.lang.String oid, byte[] value)
      Creates a X509Extension object with specified oid and value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getOid()
      Returns the oid of this extension.
      byte[] getValue()
      Returns the actual value of the extension (not octet string encoded)
      boolean isCritical()
      Determines whether or not this extension is critical.
      void setCritical​(boolean critical)
      Sets the extension as critical or noncritical.
      void setOid​(java.lang.String oid)
      Sets the oid of this extension.
      void setValue​(byte[] value)
      Sets the actual value of the extension (not octet string encoded).
      • Methods inherited from class java.lang.Object

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

      • critical

        protected boolean critical
      • value

        protected byte[] value
      • oid

        protected java.lang.String oid
      • i18n

        private static I18n i18n
    • Constructor Detail

      • X509Extension

        public X509Extension​(java.lang.String oid)
        Creates a X509Extension object with specified oid. The extension has no value and is marked as noncritical.
        Parameters:
        oid - the oid of the extension
      • X509Extension

        public X509Extension​(java.lang.String oid,
                             byte[] value)
        Creates a X509Extension object with specified oid and value. The extension is marked as noncritical.
        Parameters:
        oid - the oid of the extension
        value - the actual value of the extension (not octet string encoded). The value can be null.
      • X509Extension

        public X509Extension​(java.lang.String oid,
                             boolean critical,
                             byte[] value)
        Creates a X509Extension object with specified oid, critical property, and value.
        Parameters:
        oid - the oid of the extension
        critical - the critical value.
        value - the actual value of the extension (not octet string encoded). The value can be null.
    • Method Detail

      • setOid

        public void setOid​(java.lang.String oid)
        Sets the oid of this extension.
        Parameters:
        oid - the oid of this extension. Cannot not null.
      • getOid

        public java.lang.String getOid()
        Returns the oid of this extension.
        Returns:
        the oid of this extension. Always non-null.
      • setCritical

        public void setCritical​(boolean critical)
        Sets the extension as critical or noncritical.
        Parameters:
        critical - the critical value.
      • isCritical

        public boolean isCritical()
        Determines whether or not this extension is critical.
        Returns:
        true if extension is critical, false otherwise.
      • setValue

        public void setValue​(byte[] value)
        Sets the actual value of the extension (not octet string encoded).
        Parameters:
        value - the actual value of the extension. Can be null.
      • getValue

        public byte[] getValue()
        Returns the actual value of the extension (not octet string encoded)
        Returns:
        the actual value of the extension (not octet string encoded). Null if value not set.