Class X509CertificateUtility
Supporting class for certificate based operations
Inheritance
System.Object
X509CertificateUtility
Namespace: PnP.Framework.Utilities
Assembly: PnP.Framework.dll
Syntax
public static class X509CertificateUtility : object
Methods
Decrypt(Byte[], Boolean, X509Certificate2)
Decrypts data based on the RSACryptoServiceProvider
Declaration
public static byte[] Decrypt(byte[] encryptedData, bool fOAEP, X509Certificate2 certificate)
Parameters
System. Bytes to decrypt |
System. true to perform direct System.Security.Cryptography.RSA decryption using OAEP padding |
X509Certificate2
certificate
Certificate to use |
Returns
System. Decrypted bytes |
Encrypt(Byte[], Boolean, X509Certificate2)
Encrypts data based on the RSACryptoServiceProvider
Declaration
public static byte[] Encrypt(byte[] plainData, bool fOAEP, X509Certificate2 certificate)
Parameters
System. Bytes to encrypt |
System. true to perform direct System.Security.Cryptography.RSA decryption using OAEP padding |
X509Certificate2
certificate
Certificate to use |
Returns
System. Encrypted bytes |
GetPublicKey(X509Certificate2)
Returns the certificate public key
Declaration
public static string GetPublicKey(X509Certificate2 certificate)
Parameters
X509Certificate2
certificate
Certificate to operate on |
Returns
System. Public key of the certificate |
LoadCertificate(StoreName, StoreLocation, String)
Loads a certificate from a given certificate store
Declaration
public static X509Certificate2 LoadCertificate(StoreName storeName, StoreLocation storeLocation, string thumbprint)
Parameters
Store Name of the certificate store |
Store Location of the certificate store |
System. Thumbprint of the certificate to load |
Returns
X509Certificate2
An |