Skip to content

CertificateExtensions Class ​

Definition ​

Extensions for the X509Certificate2 class

  • Namespace: JASE.Extensions
  • Assembly: JASE.Crypto.dll

Methods ​

NameDescription
SubjectIdentifierType CmsIdType(X509Certificate2 certificate)Resolves the preferred Identifier Type for Cms operations
string ExportPrivateKey(X509Certificate2 certificate, AsymmetricAlgorithm algorithm, bool wrapWithHeader = null, string keyString = null)Export the Private key as an RSA encoded
string ExportPublicKey(X509Certificate2 certificate, bool wrapWithHeader = null, string keyString = null)Export certificates public key in the requested algorithm
bool IsValidTimeRange(X509Certificate2 certificate)Compares Certificate NotBefore and NotAfter to the current time
string SignData(X509Certificate2 certificate, byte[] input, HashProvider hash, bool allowInvalidTime = null, RsaSignaturePadding? padding = null)Sign data using the certificate's private key at the request hash type
string SignData(X509Certificate2 certificate, string input, HashProvider hash, bool allowInvalidTime = null)Sign data using the certificate's private key at the request hash type
bool VerifyData(X509Certificate2 certificate, byte[] input, string signature, HashProvider hash, bool allowInvalidTime = null, bool supressException = null, RsaSignaturePadding? padding = null)Verify that the signature was signed by the current certificate
bool VerifyData(X509Certificate2 certificate, string input, string signature, HashProvider hash, bool allowInvalidTime = null, bool supressException = null)Verify that the signature was signed by the current certificate