<PackageReference Include="BouncyCastle.Cryptography" Version="2.4.0" />

X509V3CertificateGenerator

A class to Generate Version 3 X509Certificates.
public IEnumerable<string> SignatureAlgNames { get; }

Allows enumeration of the signature names supported by the generator.

Create a generator for a version 3 certificate, initialised with another certificate.

public void AddExtension(string oid, bool critical, Asn1Encodable extensionValue)

Add a given extension field for the standard extensions tag (tag 3).

public void AddExtension(DerObjectIdentifier oid, bool critical, Asn1Encodable extensionValue)

Add an extension to this certificate.

public void AddExtension(string oid, bool critical, byte[] extensionValue)

Add an extension using a string with a dotted decimal OID.

public void AddExtension(DerObjectIdentifier oid, bool critical, byte[] extensionValue)

Add an extension to this certificate.

public void CopyAndAddExtension(string oid, bool critical, X509Certificate cert)

Add a given extension field for the standard extensions tag (tag 3), copying the extension value from another certificate.

public void CopyAndAddExtension(DerObjectIdentifier oid, bool critical, X509Certificate cert)

public X509Certificate Generate(ISignatureFactory signatureFactory)

Generate a new X509Certificate using the provided ISignatureFactory.

public X509Certificate Generate(ISignatureFactory signatureFactory, bool isCritical, ISignatureFactory altSignatureFactory)

Generate a new X509Certificate using the provided ISignatureFactory and containing altSignatureAlgorithm and altSignatureValue extensions based on the passed altSignatureFactory.

public void Reset()

Reset the Generator.

public void SetIssuerDN(X509Name issuer)

Set the distinguished name of the issuer. The issuer is the entity which is signing the certificate.

public void SetIssuerUniqueID(bool[] uniqueID)

Set the issuer unique ID - note: it is very rare that it is correct to do this.

public void SetNotAfter(DateTime date)

Set the date after which this certificate will no longer be valid.

public void SetNotBefore(DateTime date)

Set the date that this certificate is to be valid from.

public void SetPublicKey(AsymmetricKeyParameter publicKey)

Set the public key that this certificate identifies.

public void SetSerialNumber(BigInteger serialNumber)

Set the certificate's serial number.

public void SetSubjectDN(X509Name subject)

Set the DN of the entity that this certificate is about.

public void SetSubjectPublicKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo)

Set the SubjectPublicKeyInfo for the public key that this certificate identifies.

public void SetSubjectUniqueID(bool[] uniqueID)

Set the subject unique ID - note: it is very rare that it is correct to do this.