public X509V3CertificateGenerator() { tbsGen = new V3TBSCertificateGenerator(); extGenerator = new X509ExtensionsGenerator(); }
/** * reset the generator */ public void reset() { tbsGen = new V2TBSCertListGenerator(); extGenerator.reset(); }
final X509ExtensionsGenerator extsGen = new X509ExtensionsGenerator(); usage = KeyUsage.keyEncipherment | KeyUsage.digitalSignature; extsGen.addExtension(X509Extensions.KeyUsage, true, new KeyUsage(usage)); extsGen.addExtension(X509Extensions.SubjectAlternativeName, false, altName); extsGen.addExtension(X509Extensions.ExtendedKeyUsage, false, new ExtendedKeyUsage(purposes)); extsGen.addExtension(X509Extensions.BasicConstraints, true, bc); final X509Extensions exts = extsGen.generate();
/** * add a given extension field for the standard extensions tag (tag 3) */ public void addExtension( ASN1ObjectIdentifier oid, boolean critical, byte[] value) { extGenerator.addExtension(new ASN1ObjectIdentifier(oid.getId()), critical, value); }
final X509ExtensionsGenerator extsGen = new X509ExtensionsGenerator(); usage = KeyUsage.keyEncipherment | KeyUsage.digitalSignature; extsGen.addExtension(X509Extensions.KeyUsage, true, new KeyUsage(usage)); extsGen.addExtension(X509Extensions.SubjectAlternativeName, false, altName); extsGen.addExtension(X509Extensions.ExtendedKeyUsage, false, new ExtendedKeyUsage(purposes)); extsGen.addExtension(X509Extensions.BasicConstraints, true, bc); final X509Extensions exts = extsGen.generate();
/** * add a given extension field for the standard extensions tag (tag 0) */ public void addExtension( ASN1ObjectIdentifier oid, boolean critical, byte[] value) { extGenerator.addExtension(new ASN1ObjectIdentifier(oid.getId()), critical, value); }
/** * add a given extension field for the standard extensions tag (tag 3) */ public void addExtension( ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value) { extGenerator.addExtension(new ASN1ObjectIdentifier(oid.getId()), critical, value); }
public X509V2CRLGenerator() { tbsGen = new V2TBSCertListGenerator(); extGenerator = new X509ExtensionsGenerator(); }
/** * reset the generator */ public void reset() { tbsGen = new V3TBSCertificateGenerator(); extGenerator.reset(); }
/** * add a given extension field for the standard extensions tag (tag 0) */ public void addExtension( ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value) { extGenerator.addExtension(new ASN1ObjectIdentifier(oid.getId()), critical, value); }
/** * Add an extension with the given oid and the passed in value to be included * in the OCTET STRING associated with the extension. * * @param oid OID for the extension. * @param critical true if critical, false otherwise. * @param value the ASN.1 object to be included in the extension. */ public void addExtension( ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value) { try { this.addExtension(oid, critical, value.toASN1Primitive().getEncoded(ASN1Encoding.DER)); } catch (IOException e) { throw new IllegalArgumentException("error encoding value: " + e); } }
/** * Add an extension with the given oid and the passed in value to be included * in the OCTET STRING associated with the extension. * * @param oid OID for the extension. * @param critical true if critical, false otherwise. * @param value the ASN.1 object to be included in the extension. */ public void addExtension( ASN1ObjectIdentifier oid, boolean critical, ASN1Encodable value) { try { this.addExtension(oid, critical, value.toASN1Primitive().getEncoded(ASN1Encoding.DER)); } catch (IOException e) { throw new IllegalArgumentException("error encoding value: " + e); } }