/** * 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); }
/** * 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); }
/** * 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); } }
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);
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);