Dela via


CertificatePolicy Constructors

Definition

Overloads

CertificatePolicy()

Initializes a new instance of the CertificatePolicy class to pass to ImportCertificate(ImportCertificateOptions, CancellationToken) or ImportCertificateAsync(ImportCertificateOptions, CancellationToken).

CertificatePolicy(String, SubjectAlternativeNames)

Initializes a new instance of the CertificatePolicy class.

CertificatePolicy(String, String)

Initializes a new instance of the CertificatePolicy class.

CertificatePolicy(String, String, SubjectAlternativeNames)

Initializes a new instance of the CertificatePolicy class.

CertificatePolicy()

Source:
CertificatePolicy.cs
Source:
CertificatePolicy.cs
public CertificatePolicy ();
Public Sub New ()

Remarks

Use this constructor if, for example, you want to import a PEM-encoded certificate. The IssuerName will be Unknown and the Subject and SubjectAlternativeNames will be parsed from the imported certificate.

byte[] certificateBytes = File.ReadAllBytes("certificate.pem");

ImportCertificateOptions options = new ImportCertificateOptions(certificateName, certificateBytes)
{
    Policy = new CertificatePolicy
    {
        ContentType = CertificateContentType.Pem
    }
};

You must use one of the other constructors to pass an instance to StartCreateCertificate(String, CertificatePolicy, Nullable<Boolean>, IDictionary<String,String>, CancellationToken) or StartCreateCertificateAsync(String, CertificatePolicy, Nullable<Boolean>, IDictionary<String,String>, CancellationToken) because IssuerName and one of Subject or SubjectAlternativeNames are required.

Applies to

CertificatePolicy(String, SubjectAlternativeNames)

Source:
CertificatePolicy.cs
Source:
CertificatePolicy.cs

Initializes a new instance of the CertificatePolicy class.

public CertificatePolicy (string issuerName, Azure.Security.KeyVault.Certificates.SubjectAlternativeNames subjectAlternativeNames);
new Azure.Security.KeyVault.Certificates.CertificatePolicy : string * Azure.Security.KeyVault.Certificates.SubjectAlternativeNames -> Azure.Security.KeyVault.Certificates.CertificatePolicy
Public Sub New (issuerName As String, subjectAlternativeNames As SubjectAlternativeNames)

Parameters

issuerName
String

The name of an issuer for the certificate, including values from WellKnownIssuerNames.

subjectAlternativeNames
SubjectAlternativeNames

The subject alternative names (SANs) of the certificate.

Exceptions

issuerName is empty or subjectAlternativeNames contains empty collection properties.

subjectAlternativeNames or issuerName is null.

Applies to

CertificatePolicy(String, String)

Source:
CertificatePolicy.cs
Source:
CertificatePolicy.cs

Initializes a new instance of the CertificatePolicy class.

public CertificatePolicy (string issuerName, string subject);
new Azure.Security.KeyVault.Certificates.CertificatePolicy : string * string -> Azure.Security.KeyVault.Certificates.CertificatePolicy
Public Sub New (issuerName As String, subject As String)

Parameters

issuerName
String

The name of an issuer for the certificate, including values from WellKnownIssuerNames.

subject
String

The subject name of the certificate, such as "CN=contoso.com".

Exceptions

subject or issuerName is empty.

subject or issuerName is null.

Applies to

CertificatePolicy(String, String, SubjectAlternativeNames)

Source:
CertificatePolicy.cs
Source:
CertificatePolicy.cs

Initializes a new instance of the CertificatePolicy class.

public CertificatePolicy (string issuerName, string subject, Azure.Security.KeyVault.Certificates.SubjectAlternativeNames subjectAlternativeNames);
new Azure.Security.KeyVault.Certificates.CertificatePolicy : string * string * Azure.Security.KeyVault.Certificates.SubjectAlternativeNames -> Azure.Security.KeyVault.Certificates.CertificatePolicy
Public Sub New (issuerName As String, subject As String, subjectAlternativeNames As SubjectAlternativeNames)

Parameters

issuerName
String

The name of an issuer for the certificate, including values from WellKnownIssuerNames.

subject
String

The subject name of the certificate, such as "CN=contoso.com".

subjectAlternativeNames
SubjectAlternativeNames

The subject alternative names (SANs) of the certificate.

Exceptions

subject or issuerName is empty, or subjectAlternativeNames contains empty collection properties.

subject, issuerName, or subjectAlternativeNames is null.

Applies to