<PackageReference Include="BouncyCastle.Cryptography" Version="2.1.0" />

X509Certificate

An Object representing an X509 Certificate. Has static methods for loading Certificates encoded in many forms that return X509Certificate Objects.

public virtual X509Name IssuerDN { get; }

Get the Issuer Distinguished Name. (Who signed the certificate.)

public virtual DerBitString IssuerUniqueID { get; }

Get the issuers UID.

public virtual bool IsValidNow { get; }

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

public virtual DateTime NotAfter { get; }

The time that this certificate is valid up to.

public virtual DateTime NotBefore { get; }

The time that this certificate is valid from.

public virtual BigInteger SerialNumber { get; }

Return a BigIntegerBigInteger containing the serial number.

public virtual string SigAlgName { get; }

A meaningful version of the Signature Algorithm. (EG SHA1WITHRSA)

public virtual string SigAlgOid { get; }

Get the Signature Algorithms Object ID.

public virtual X509Name SubjectDN { get; }

Get the subject of this certificate.

public virtual DerBitString SubjectUniqueID { get; }

Get the subjects UID.

public virtual int Version { get; }

Return the certificate's version.

protected X509Certificate()

public X509Certificate(byte[] certData)

protected virtual void CheckSignature(IVerifierFactory verifier)

public virtual void CheckValidity()

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

public virtual void CheckValidity(DateTime time)

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

protected virtual IList<IList<object>> GetAlternativeNames(DerObjectIdentifier oid)

public virtual int GetBasicConstraints()

public virtual byte[] GetEncoded()

Return the DER encoding of this certificate.

public virtual IList<IList<object>> GetIssuerAlternativeNames()

public virtual bool[] GetKeyUsage()

Get a key usage guidlines.

Get the public key of the subject of the certificate.

public virtual byte[] GetSigAlgParams()

Get the signature algorithms parameters. (EG DSA Parameters)

public virtual byte[] GetSignature()

The signature.

public virtual IList<IList<object>> GetSubjectAlternativeNames()

public virtual byte[] GetTbsCertificate()

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

public virtual bool IsValid(DateTime time)

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

public virtual void Verify(AsymmetricKeyParameter key)

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

public virtual void Verify(IVerifierFactoryProvider verifierProvider)

Verify the certificate's signature using a verifier created using the passed in verifier provider.