Class ExtensionsGenerator

java.lang.Object
org.bouncycastle.asn1.x509.ExtensionsGenerator

public class ExtensionsGenerator extends Object
Generator for X.509 extensions
  • Constructor Details

    • ExtensionsGenerator

      public ExtensionsGenerator()
  • Method Details

    • reset

      public void reset()
      Reset the generator
    • addExtension

      public void addExtension(ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value) throws IOException
      Add an extension with the given oid and the passed in value to be included in the OCTET STRING associated with the extension.
      Parameters:
      oid - OID for the extension.
      critical - true if critical, false otherwise.
      value - the ASN.1 object to be included in the extension.
      Throws:
      IOException
    • addExtension

      public void addExtension(ASN1ObjectIdentifier oid, boolean critical, byte[] value)
      Add an extension with the given oid and the passed in byte array to be wrapped in the OCTET STRING associated with the extension.
      Parameters:
      oid - OID for the extension.
      critical - true if critical, false otherwise.
      value - the byte array to be wrapped.
    • addExtension

      public void addExtension(Extension extension)
      Add a given extension.
      Parameters:
      extension - the full extension value.
    • isEmpty

      public boolean isEmpty()
      Return true if there are no extension present in this generator.
      Returns:
      true if empty, false otherwise
    • generate

      public Extensions generate()
      Generate an Extensions object based on the current state of the generator.
      Returns:
      an X09Extensions object.