C# Class Org.BouncyCastle.X509.X509V1CertificateGenerator

Class to Generate X509V1 Certificates.
Show file Open project: JamieMellway/iTextSharpLGPL-Monotouch Class Usage Examples

Public Methods

Method Description
Generate ( AsymmetricKeyParameter privateKey ) : X509Certificate

Generate a new X509Certificate.

Generate ( AsymmetricKeyParameter privateKey, SecureRandom random ) : X509Certificate

Generate a new X509Certificate specifying a SecureRandom instance that you would like to use.

Reset ( ) : void

Reset the generator.

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

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

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. This can be either a name or an OID, names are treated as case insensitive.

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

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

X509V1CertificateGenerator ( ) : System

Default Constructor.

Private Methods

Method Description
GenerateJcaObject ( TbsCertificateStructure tbsCert, byte signature ) : X509Certificate

Method Details

Generate() public method

Generate a new X509Certificate.
public Generate ( AsymmetricKeyParameter privateKey ) : X509Certificate
privateKey Org.BouncyCastle.Crypto.AsymmetricKeyParameter The private key of the issuer used to sign this certificate.
return X509Certificate

Generate() public method

Generate a new X509Certificate specifying a SecureRandom instance that you would like to use.
public Generate ( AsymmetricKeyParameter privateKey, SecureRandom random ) : X509Certificate
privateKey Org.BouncyCastle.Crypto.AsymmetricKeyParameter The private key of the issuer used to sign this certificate.
random Org.BouncyCastle.Security.SecureRandom The Secure Random you want to use.
return X509Certificate

Reset() public method

Reset the generator.
public Reset ( ) : void
return void

SetIssuerDN() public method

Set the issuer distinguished name. The issuer is the entity whose private key is used to sign the certificate.
public SetIssuerDN ( Org.BouncyCastle.Asn1.X509.X509Name issuer ) : void
issuer Org.BouncyCastle.Asn1.X509.X509Name The issuers DN.
return void

SetNotAfter() public method

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

SetNotBefore() public method

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

SetPublicKey() public method

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

SetSerialNumber() public method

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.
return void

SetSignatureAlgorithm() public method

Set the signature algorithm that will be used to sign this certificate. This can be either a name or an OID, names are treated as case insensitive.
public SetSignatureAlgorithm ( string signatureAlgorithm ) : void
signatureAlgorithm string string representation of the algorithm name
return void

SetSubjectDN() public method

Set the subject distinguished name. The subject describes the entity associated with the public key.
public SetSubjectDN ( Org.BouncyCastle.Asn1.X509.X509Name subject ) : void
subject Org.BouncyCastle.Asn1.X509.X509Name
return void

X509V1CertificateGenerator() public method

Default Constructor.
public X509V1CertificateGenerator ( ) : System
return System