C# Class Org.BouncyCastle.X509.X509Certificate

An Object representing an X509 Certificate. Has static methods for loading Certificates encoded in many forms that return X509Certificate Objects.
Inheritance: X509ExtensionBase
Show file Open project: nonorganic/dssnet Class Usage Examples

Public Methods

Method Description
CheckValidity ( ) : void

Checks if the current date is within certificate's validity period.

CheckValidity ( System.DateTime time ) : void

Checks if the given date is within certificate's validity period.

Equals ( object obj ) : bool
GetBasicConstraints ( ) : int
GetEncoded ( ) : byte[]

Return a Der encoded version of this certificate.

GetExtendedKeyUsage ( ) : IList
GetHashCode ( ) : int
GetIssuerAlternativeNames ( ) : ICollection
GetKeyUsage ( ) : bool[]

Get a key usage guidlines.

GetPublicKey ( ) : AsymmetricKeyParameter

Get the public key of the subject of the certificate.

GetSigAlgParams ( ) : byte[]

Get the signature algorithms parameters. (EG DSA Parameters)

GetSignature ( ) : byte[]

The signature.

GetSubjectAlternativeNames ( ) : ICollection
GetTbsCertificate ( ) : byte[]

Return the Der encoded TbsCertificate data. This is the certificate component less the signature. To Get the whole certificate call the GetEncoded() member.

IsValid ( DateTime time ) : bool

Return true if the nominated time is within the start and end times nominated on the certificate.

ToString ( ) : string
Verify ( AsymmetricKeyParameter key ) : void

Verify the certificate's signature using the nominated public key.

X509Certificate ( X509CertificateStructure c ) : System

Protected Methods

Method Description
CheckSignature ( AsymmetricKeyParameter publicKey, ISigner signature ) : void
GetAlternativeNames ( string oid ) : ICollection
GetX509Extensions ( ) : X509Extensions
X509Certificate ( ) : System

Private Methods

Method Description
IsAlgIDEqual ( AlgorithmIdentifier id1, AlgorithmIdentifier id2 ) : bool

Method Details

CheckSignature() protected method

protected CheckSignature ( AsymmetricKeyParameter publicKey, ISigner signature ) : void
publicKey Org.BouncyCastle.Crypto.AsymmetricKeyParameter
signature ISigner
return void

CheckValidity() public method

Checks if the current date is within certificate's validity period.
public CheckValidity ( ) : void
return void

CheckValidity() public method

Checks if the given date is within certificate's validity period.
if the certificate is expired by given date if the certificate is not yet valid on given date
public CheckValidity ( System.DateTime time ) : void
time System.DateTime
return void

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool

GetAlternativeNames() protected method

protected GetAlternativeNames ( string oid ) : ICollection
oid string
return ICollection

GetBasicConstraints() public method

public GetBasicConstraints ( ) : int
return int

GetEncoded() public method

Return a Der encoded version of this certificate.
public GetEncoded ( ) : byte[]
return byte[]

GetExtendedKeyUsage() public method

public GetExtendedKeyUsage ( ) : IList
return IList

GetHashCode() public method

public GetHashCode ( ) : int
return int

GetIssuerAlternativeNames() public method

public GetIssuerAlternativeNames ( ) : ICollection
return ICollection

GetKeyUsage() public method

Get a key usage guidlines.
public GetKeyUsage ( ) : bool[]
return bool[]

GetPublicKey() public method

Get the public key of the subject of the certificate.
public GetPublicKey ( ) : AsymmetricKeyParameter
return AsymmetricKeyParameter

GetSigAlgParams() public method

Get the signature algorithms parameters. (EG DSA Parameters)
public GetSigAlgParams ( ) : byte[]
return byte[]

GetSignature() public method

The signature.
public GetSignature ( ) : byte[]
return byte[]

GetSubjectAlternativeNames() public method

public GetSubjectAlternativeNames ( ) : ICollection
return ICollection

GetTbsCertificate() public method

Return the Der encoded TbsCertificate data. This is the certificate component less the signature. To Get the whole certificate call the GetEncoded() member.
public GetTbsCertificate ( ) : byte[]
return byte[]

GetX509Extensions() protected method

protected GetX509Extensions ( ) : X509Extensions
return X509Extensions

IsValid() public method

Return true if the nominated time is within the start and end times nominated on the certificate.
public IsValid ( DateTime time ) : bool
time DateTime The time to test validity against.
return bool

ToString() public method

public ToString ( ) : string
return string

Verify() public method

Verify the certificate's signature using the nominated public key.
If key submitted is not of the above nominated types.
public Verify ( AsymmetricKeyParameter key ) : void
key AsymmetricKeyParameter An appropriate public key parameter object, RsaPublicKeyParameters, DsaPublicKeyParameters or ECDsaPublicKeyParameters
return void

X509Certificate() protected method

protected X509Certificate ( ) : System
return System

X509Certificate() public method

public X509Certificate ( X509CertificateStructure c ) : System
c X509CertificateStructure
return System