C# Класс Microsoft.Azure.Commands.SiteRecovery.CertUtils

Class to provide methods to manage the certificates.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CreateSelfSignedCertificate ( int validForHours, string subscriptionId, string certificateNamePrefix, string issuer = DefaultIssuer, string password = DefaultPassword ) : X509Certificate2

Method to generate a self signed certificate

GetCertInBase64EncodedForm ( string certFileName ) : string

Method to get the Certificate's base 64 encoded string

NewX509Certificate2 ( byte rawData, string password, X509KeyStorageFlags keyStorageFlags, bool shouldValidatePfx ) : X509Certificate2

Provides a similar API call to new X509Certificate(byte[],string,X509KeyStorageFlags)

Приватные методы

Метод Описание
Create2048RsaKey ( ) : System.Security.Cryptography.CngKey

Windows Azure Service Management API requires 2048bit RSA keys. The private key needs to be exportable so we can save it for sharing with team members.

GenerateCertFriendlyName ( string subscriptionId, string prefix = "" ) : string

Generates friendly name

Описание методов

CreateSelfSignedCertificate() публичный статический Метод

Method to generate a self signed certificate
public static CreateSelfSignedCertificate ( int validForHours, string subscriptionId, string certificateNamePrefix, string issuer = DefaultIssuer, string password = DefaultPassword ) : X509Certificate2
validForHours int number of hours for which the certificate is valid.
subscriptionId string subscriptionId in question
certificateNamePrefix string prefix for the certificate name
issuer string issuer for the certificate
password string certificate password
Результат System.Security.Cryptography.X509Certificates.X509Certificate2

GetCertInBase64EncodedForm() публичный статический Метод

Method to get the Certificate's base 64 encoded string
public static GetCertInBase64EncodedForm ( string certFileName ) : string
certFileName string Certificate File Name
Результат string

NewX509Certificate2() публичный статический Метод

Provides a similar API call to new X509Certificate(byte[],string,X509KeyStorageFlags)
public static NewX509Certificate2 ( byte rawData, string password, X509KeyStorageFlags keyStorageFlags, bool shouldValidatePfx ) : X509Certificate2
rawData byte The bytes that represent the certificate
password string The certificate private password
keyStorageFlags X509KeyStorageFlags The certificate loading options
shouldValidatePfx bool Flag to indicate if file should validated. Set to true if the rawData is retrieved from an untrusted source.
Результат System.Security.Cryptography.X509Certificates.X509Certificate2