Table of Contents

Class X509V1CertificateGenerator

Namespace
Org.BouncyCastle.X509
Assembly
BouncyCastle.Cryptography.dll

Class to Generate X509V1 Certificates.

public class X509V1CertificateGenerator
Inheritance
X509V1CertificateGenerator
Inherited Members

Constructors

X509V1CertificateGenerator()

Default Constructor.

public X509V1CertificateGenerator()

Properties

SignatureAlgNames

Allows enumeration of the signature names supported by the generator.

public IEnumerable<string> SignatureAlgNames { get; }

Property Value

IEnumerable<string>

Methods

Generate(ISignatureFactory)

Generate a new X509Certificate using the provided ISignatureFactory.

public X509Certificate Generate(ISignatureFactory signatureFactory)

Parameters

signatureFactory ISignatureFactory

A signature factory with the necessary algorithm details.

Returns

X509Certificate

An X509Certificate.

Reset()

Reset the generator.

public void Reset()

SetIssuerDN(X509Name)

Set the issuer distinguished name. The issuer is the entity whose private key is used to sign the certificate.

public void SetIssuerDN(X509Name issuer)

Parameters

issuer X509Name

The issuers DN.

SetNotAfter(DateTime)

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

public void SetNotAfter(DateTime date)

Parameters

date DateTime

SetNotBefore(DateTime)

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

public void SetNotBefore(DateTime date)

Parameters

date DateTime

SetPublicKey(AsymmetricKeyParameter)

Set the public key that this certificate identifies.

public void SetPublicKey(AsymmetricKeyParameter publicKey)

Parameters

publicKey AsymmetricKeyParameter

SetSerialNumber(BigInteger)

Set the certificate's serial number.

public void SetSerialNumber(BigInteger serialNumber)

Parameters

serialNumber BigInteger

The serial number.

Remarks

Make serial numbers long, if you have no serial number policy make sure the number is at least 16 bytes of secure random data. You will be surprised how ugly a serial number collision can get.

SetSubjectDN(X509Name)

Set the subject distinguished name. The subject describes the entity associated with the public key.

public void SetSubjectDN(X509Name subject)

Parameters

subject X509Name

SetValidity(Validity)

public void SetValidity(Validity validity)

Parameters

validity Validity