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
Methods
Generate(ISignatureFactory)
Generate a new X509Certificate using the provided ISignatureFactory.
public X509Certificate Generate(ISignatureFactory signatureFactory)
Parameters
signatureFactoryISignatureFactoryA signature factory with the necessary algorithm details.
Returns
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
issuerX509NameThe issuers DN.
SetNotAfter(DateTime)
Set the date after which this certificate will no longer be valid.
public void SetNotAfter(DateTime date)
Parameters
dateDateTime
SetNotBefore(DateTime)
Set the date that this certificate is to be valid from.
public void SetNotBefore(DateTime date)
Parameters
dateDateTime
SetPublicKey(AsymmetricKeyParameter)
Set the public key that this certificate identifies.
public void SetPublicKey(AsymmetricKeyParameter publicKey)
Parameters
publicKeyAsymmetricKeyParameter
SetSerialNumber(BigInteger)
Set the certificate's serial number.
public void SetSerialNumber(BigInteger serialNumber)
Parameters
serialNumberBigIntegerThe 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
subjectX509Name
SetValidity(Validity)
public void SetValidity(Validity validity)
Parameters
validityValidity