C# Class Org.BouncyCastle.X509.X509V3CertificateGenerator

A class to Generate Version 3 X509Certificates.
Afficher le fichier Open project: JamieMellway/iTextSharpLGPL-Monotouch Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
GenerateJcaObject ( TbsCertificateStructure tbsCert, byte signature ) : X509Certificate
GenerateTbsCert ( ) : TbsCertificateStructure
booleanToBitString ( bool id ) : DerBitString

Method Details

AddExtension() public méthode

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.
Résultat void

AddExtension() public méthode

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.
Résultat void

AddExtension() public méthode

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.
Résultat void

AddExtension() public méthode

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.
Résultat void

CopyAndAddExtension() public méthode

public CopyAndAddExtension ( DerObjectIdentifier oid, bool critical, X509Certificate cert ) : void
oid Org.BouncyCastle.Asn1.DerObjectIdentifier
critical bool
cert X509Certificate
Résultat void

CopyAndAddExtension() public méthode

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
Résultat void

Generate() public méthode

Generate an X509Certificate.
public Generate ( AsymmetricKeyParameter privateKey ) : X509Certificate
privateKey Org.BouncyCastle.Crypto.AsymmetricKeyParameter The private key of the issuer that is signing this certificate.
Résultat X509Certificate

Generate() public méthode

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.
Résultat X509Certificate

Reset() public méthode

Reset the Generator.
public Reset ( ) : void
Résultat void

SetIssuerDN() public méthode

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.
Résultat void

SetIssuerUniqueID() public méthode

Set the issuer unique ID - note: it is very rare that it is correct to do this.
public SetIssuerUniqueID ( bool uniqueID ) : void
uniqueID bool
Résultat void

SetNotAfter() public méthode

Set the date after which this certificate will no longer be valid.
public SetNotAfter ( System.DateTime date ) : void
date System.DateTime
Résultat void

SetNotBefore() public méthode

Set the date that this certificate is to be valid from.
public SetNotBefore ( System.DateTime date ) : void
date System.DateTime
Résultat void

SetPublicKey() public méthode

Set the public key that this certificate identifies.
public SetPublicKey ( AsymmetricKeyParameter publicKey ) : void
publicKey Org.BouncyCastle.Crypto.AsymmetricKeyParameter
Résultat void

SetSerialNumber() public méthode

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.
Résultat void

SetSignatureAlgorithm() public méthode

Set the signature algorithm that will be used to sign this certificate.
public SetSignatureAlgorithm ( string signatureAlgorithm ) : void
signatureAlgorithm string
Résultat void

SetSubjectDN() public méthode

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
Résultat void

SetSubjectUniqueID() public méthode

Set the subject unique ID - note: it is very rare that it is correct to do this.
public SetSubjectUniqueID ( bool uniqueID ) : void
uniqueID bool
Résultat void

X509V3CertificateGenerator() public méthode

public X509V3CertificateGenerator ( ) : System
Résultat System