Certificates in C#
The namespace responsible for all concepts is "System.Security" Furthermore, the namespace specific to the certification concept is "System.Security.Cryptography.X509Certificates". The X509Certificates class is mainly used to generate a certificate for an individual solution.
The System.Security.Cryptography.X509Certificates namespace contains the common language run time implementation of the Authenticode X.509 v.3 certificate. This certificate is signed with a private key that uniquely identifies the holder of the certificate.
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;
- }
-
- 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 the certificate object you should have your actual certificate.
Happy Coding :)