C# Класс Org.BouncyCastle.X509.X509V3CertificateGenerator

A class to Generate Version 3 X509Certificates.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddExtension ( DerObjectIdentifier oid, bool critical, Asn1Encodable extensionValue ) : void

Add an extension to this certificate.

AddExtension ( DerObjectIdentifier oid, bool critical, byte extensionValue ) : void

Add an extension to this certificate.

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

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

AddExtension ( string oid, bool critical, byte extensionValue ) : void

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

CopyAndAddExtension ( DerObjectIdentifier oid, bool critical, X509Certificate cert ) : void
CopyAndAddExtension ( string oid, bool critical, X509Certificate cert ) : void

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

Generate ( AsymmetricKeyParameter privateKey ) : X509Certificate

Generate an X509Certificate.

Generate ( AsymmetricKeyParameter privateKey, SecureRandom random ) : X509Certificate

Generate an X509Certificate using your own SecureRandom.

Reset ( ) : void

Reset the Generator.

SetIssuerDN ( Org.BouncyCastle.Asn1.X509.X509Name issuer ) : void

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

SetIssuerUniqueID ( bool uniqueID ) : void

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

SetNotAfter ( System.DateTime date ) : void

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

SetNotBefore ( System.DateTime date ) : void

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

SetPublicKey ( AsymmetricKeyParameter publicKey ) : void

Set the public key that this certificate identifies.

SetSerialNumber ( BigInteger serialNumber ) : void

Set the certificate's serial number.

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.

SetSignatureAlgorithm ( string signatureAlgorithm ) : void

Set the signature algorithm that will be used to sign this certificate.

SetSubjectDN ( Org.BouncyCastle.Asn1.X509.X509Name subject ) : void

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

SetSubjectUniqueID ( bool uniqueID ) : void

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

X509V3CertificateGenerator ( ) : System

Приватные методы

Метод Описание
GenerateJcaObject ( TbsCertificateStructure tbsCert, byte signature ) : X509Certificate
GenerateTbsCert ( ) : TbsCertificateStructure
booleanToBitString ( bool id ) : DerBitString

Описание методов

AddExtension() публичный Метод

Add an extension to this certificate.
public AddExtension ( DerObjectIdentifier oid, bool critical, Asn1Encodable extensionValue ) : void
oid Org.BouncyCastle.Asn1.DerObjectIdentifier Its Object Identifier.
critical bool Is it critical.
extensionValue Org.BouncyCastle.Asn1.Asn1Encodable The value.
Результат void

AddExtension() публичный Метод

Add an extension to this certificate.
public AddExtension ( DerObjectIdentifier oid, bool critical, byte extensionValue ) : void
oid Org.BouncyCastle.Asn1.DerObjectIdentifier Its Object Identifier.
critical bool Is it critical.
extensionValue byte byte[] containing the value of this extension.
Результат void

AddExtension() публичный Метод

Add a given extension field for the standard extensions tag (tag 3).
public AddExtension ( string oid, bool critical, Asn1Encodable extensionValue ) : void
oid string string containing a dotted decimal Object Identifier.
critical bool Is it critical.
extensionValue Org.BouncyCastle.Asn1.Asn1Encodable The value.
Результат void

AddExtension() публичный Метод

Add an extension using a string with a dotted decimal OID.
public AddExtension ( string oid, bool critical, byte extensionValue ) : void
oid string string containing a dotted decimal Object Identifier.
critical bool Is it critical.
extensionValue byte byte[] containing the value of this extension.
Результат void

CopyAndAddExtension() публичный Метод

public CopyAndAddExtension ( DerObjectIdentifier oid, bool critical, X509Certificate cert ) : void
oid Org.BouncyCastle.Asn1.DerObjectIdentifier
critical bool
cert X509Certificate
Результат void

CopyAndAddExtension() публичный Метод

Add a given extension field for the standard extensions tag (tag 3), copying the extension value from another certificate.
public CopyAndAddExtension ( string oid, bool critical, X509Certificate cert ) : void
oid string
critical bool
cert X509Certificate
Результат void

Generate() публичный Метод

Generate an X509Certificate.
public Generate ( AsymmetricKeyParameter privateKey ) : X509Certificate
privateKey Org.BouncyCastle.Crypto.AsymmetricKeyParameter The private key of the issuer that is signing this certificate.
Результат X509Certificate

Generate() публичный Метод

Generate an X509Certificate using your own SecureRandom.
public Generate ( AsymmetricKeyParameter privateKey, SecureRandom random ) : X509Certificate
privateKey Org.BouncyCastle.Crypto.AsymmetricKeyParameter The private key of the issuer that is signing this certificate.
random Org.BouncyCastle.Security.SecureRandom You Secure Random instance.
Результат X509Certificate

Reset() публичный Метод

Reset the Generator.
public Reset ( ) : void
Результат void

SetIssuerDN() публичный Метод

Set the distinguished name of the issuer. The issuer is the entity which is signing the certificate.
public SetIssuerDN ( Org.BouncyCastle.Asn1.X509.X509Name issuer ) : void
issuer Org.BouncyCastle.Asn1.X509.X509Name The issuer's DN.
Результат void

SetIssuerUniqueID() публичный Метод

Set the issuer unique ID - note: it is very rare that it is correct to do this.
public SetIssuerUniqueID ( bool uniqueID ) : void
uniqueID bool
Результат void

SetNotAfter() публичный Метод

Set the date after which this certificate will no longer be valid.
public SetNotAfter ( System.DateTime date ) : void
date System.DateTime
Результат void

SetNotBefore() публичный Метод

Set the date that this certificate is to be valid from.
public SetNotBefore ( System.DateTime date ) : void
date System.DateTime
Результат void

SetPublicKey() публичный Метод

Set the public key that this certificate identifies.
public SetPublicKey ( AsymmetricKeyParameter publicKey ) : void
publicKey Org.BouncyCastle.Crypto.AsymmetricKeyParameter
Результат void

SetSerialNumber() публичный Метод

Set the certificate's serial number.
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.
public SetSerialNumber ( BigInteger serialNumber ) : void
serialNumber Org.BouncyCastle.Math.BigInteger The serial number.
Результат void

SetSignatureAlgorithm() публичный Метод

Set the signature algorithm that will be used to sign this certificate.
public SetSignatureAlgorithm ( string signatureAlgorithm ) : void
signatureAlgorithm string
Результат void

SetSubjectDN() публичный Метод

Set the DN of the entity that this certificate is about.
public SetSubjectDN ( Org.BouncyCastle.Asn1.X509.X509Name subject ) : void
subject Org.BouncyCastle.Asn1.X509.X509Name
Результат void

SetSubjectUniqueID() публичный Метод

Set the subject unique ID - note: it is very rare that it is correct to do this.
public SetSubjectUniqueID ( bool uniqueID ) : void
uniqueID bool
Результат void

X509V3CertificateGenerator() публичный Метод

public X509V3CertificateGenerator ( ) : System
Результат System