C# Class GSF.Security.GenerateCertificate

Generates X509Certificate2s.
Mostra file Open project: GridProtectionAlliance/openHistorian Class Usage Examples

Public Methods

Method Description
CreateSelfSignedCertificate ( string subjectDirName, int signatureBits, int keyStrength ) : X509Certificate2

Creates a self signed certificate that can be used in SSL communications

CreateSelfSignedCertificate ( string subjectDirName, System.DateTime startDate, System.DateTime endDate, int signatureBits, int keyStrength, string password, string fileName ) : void

Creates new certificate

OpenCertificate ( string fileName, string password ) : X509Certificate2

Opens a certificate, loading the private key of the PFX file.

Method Details

CreateSelfSignedCertificate() public static method

Creates a self signed certificate that can be used in SSL communications
public static CreateSelfSignedCertificate ( string subjectDirName, int signatureBits, int keyStrength ) : X509Certificate2
subjectDirName string A valid DirName formated string. Example: CN=ServerName
signatureBits int Bitstrength of signature algorithm. Supported Lengths are 160,256, and 384
keyStrength int RSA key strength. Typically a multiple of 1024.
return System.Security.Cryptography.X509Certificates.X509Certificate2

CreateSelfSignedCertificate() public static method

Creates new certificate
public static CreateSelfSignedCertificate ( string subjectDirName, System.DateTime startDate, System.DateTime endDate, int signatureBits, int keyStrength, string password, string fileName ) : void
subjectDirName string
startDate System.DateTime
endDate System.DateTime
signatureBits int
keyStrength int
password string
fileName string
return void

OpenCertificate() public static method

Opens a certificate, loading the private key of the PFX file.
public static OpenCertificate ( string fileName, string password ) : X509Certificate2
fileName string
password string
return System.Security.Cryptography.X509Certificates.X509Certificate2