C# 클래스 Microsoft.Azure.Commands.RecoveryServices.CertUtils

Class to provide methods to manage the certificates.
파일 보기 프로젝트 열기: Azure/azure-powershell 1 사용 예제들

공개 메소드들

메소드 설명
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)

SerializeCert ( X509Certificate2 cert, X509ContentType contentType ) : string

Returns serialized certificate - Base64 encoded based on the content type

비공개 메소드들

메소드 설명
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

SerializeCert() 공개 정적인 메소드

Returns serialized certificate - Base64 encoded based on the content type
public static SerializeCert ( X509Certificate2 cert, X509ContentType contentType ) : string
cert System.Security.Cryptography.X509Certificates.X509Certificate2 The certificate provided
contentType X509ContentType Cert content type
리턴 string