The namespace responsible for these all concepts is using System.Security and namespace specific to certification concept is using.System.Security.Cryptography.X509Certificates. Yes this X509Certificates class is mainly used to generate the certificate for any individual solution.
The System.Security.Cryptography.X509Certificates namespace contains the common language runtime implementation of the Authenticode X.509 v.3 certificate. This certificate is signed with a private key that uniquely and positively identifies the holder of the certificate.
The System.Security.Cryptography.X509Certificates namespace contains the common language runtime implementation of the Authenticode X.509 v.3 certificate. This certificate is signed with a private key that uniquely and positively identifies the holder of the certificate.
Lets create a quick certificate from one resource file.
/First you need to get the contents of your resource file in which your encrypted data resides.
private MemoryStream getCertificate()
{
String certificateFilePath = < Your resource file path > ;
var readCertStream = new MemoryStream(File.ReadAllBytes(certificateFilePath));
return readCertStream;
}
//Second call your previous method to generate the actual certificate
private X509Certificate readCertificate(MemoryStream argInputStream, string argCertificateType)
{
X509Certificate certificate = null;
t
private X509Certificate readCertificate(MemoryStream argInputStream, string argCertificateType)
{
X509Certificate certificate = null;
certificate = new X509Certificate(getCertificate().ToArray());
return certificate;
}
}In certificate object you have your actual certificate. Lets use it as per your requirement. simple!