New-AzKeyVaultCertificatePolicy
语法
SubjectName (默认值)
New-AzKeyVaultCertificatePolicy
[-IssuerName] <String>
[-SubjectName] <String>
[-RenewAtNumberOfDaysBeforeExpiry <Int32>]
[-RenewAtPercentageLifetime <Int32>]
[-SecretContentType <String>]
[-ReuseKeyOnRenewal]
[-Disabled]
[-KeyUsage <System.Collections.Generic.List`1[System.Security.Cryptography.X509Certificates.X509KeyUsageFlags]>]
[-Ekus <System.Collections.Generic.List`1[System.String]>]
[-ValidityInMonths <Int32>]
[-CertificateType <String>]
[-EmailAtNumberOfDaysBeforeExpiry <Int32>]
[-EmailAtPercentageLifetime <Int32>]
[-KeyType <String>]
[-KeySize <Int32>]
[-KeyNotExportable]
[-CertificateTransparency <Boolean>]
[-Curve <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
DNSNames
New-AzKeyVaultCertificatePolicy
[-IssuerName] <String>
[[-SubjectName] <String>]
[-DnsName] <System.Collections.Generic.List`1[System.String]>
[-RenewAtNumberOfDaysBeforeExpiry <Int32>]
[-RenewAtPercentageLifetime <Int32>]
[-SecretContentType <String>]
[-ReuseKeyOnRenewal]
[-Disabled]
[-KeyUsage <System.Collections.Generic.List`1[System.Security.Cryptography.X509Certificates.X509KeyUsageFlags]>]
[-Ekus <System.Collections.Generic.List`1[System.String]>]
[-ValidityInMonths <Int32>]
[-CertificateType <String>]
[-EmailAtNumberOfDaysBeforeExpiry <Int32>]
[-EmailAtPercentageLifetime <Int32>]
[-KeyType <String>]
[-KeySize <Int32>]
[-KeyNotExportable]
[-CertificateTransparency <Boolean>]
[-Curve <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
New-AzKeyVaultCertificatePolicy cmdlet 为 Azure Key Vault 创建内存中证书策略对象。
示例
示例 1:创建证书策略
New-AzKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=contoso.com" -IssuerName "Self" -ValidityInMonths 6 -ReuseKeyOnRenewal
SecretContentType : application/x-pkcs12
Kty :
KeySize : 2048
Curve :
Exportable :
ReuseKeyOnRenewal : True
SubjectName : CN=contoso.com
DnsNames :
KeyUsage :
Ekus :
ValidityInMonths : 6
IssuerName : Self
CertificateType :
RenewAtNumberOfDaysBeforeExpiry :
RenewAtPercentageLifetime :
EmailAtNumberOfDaysBeforeExpiry :
EmailAtPercentageLifetime :
CertificateTransparency :
Enabled : True
Created :
Updated :
此命令创建一个证书策略,该策略有效期为 6 个月,并重复使用密钥来续订证书。
示例 2
创建内存中证书策略对象。 (autogenerated)
New-AzKeyVaultCertificatePolicy -IssuerName 'Self' -KeyType RSA -RenewAtNumberOfDaysBeforeExpiry <Int32> -SecretContentType application/x-pkcs12 -SubjectName 'CN=contoso.com' -ValidityInMonths 6
示例 3:创建使用者备用名称(或 SAN)证书
New-AzKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=contoso.com" -DnsName "contoso.com","support.contoso.com","docs.contoso.com" -IssuerName "Self"
SecretContentType : application/x-pkcs12
Kty : RSA
KeySize : 2048
Curve :
Exportable :
ReuseKeyOnRenewal : False
SubjectName : CN=contoso.com
DnsNames : {contoso.com, support.contoso.com, docs.contoso.com}
KeyUsage :
Ekus :
ValidityInMonths :
IssuerName : Self
CertificateType :
RenewAtNumberOfDaysBeforeExpiry :
RenewAtPercentageLifetime :
EmailAtNumberOfDaysBeforeExpiry :
EmailAtPercentageLifetime :
CertificateTransparency :
Enabled : True
Created :
Updated :
此示例创建一个包含 3 个 DNS 名称的 SAN 证书。
参数
-CertificateTransparency
指示是否为此证书/颁发者启用了证书透明度;如果未指定,则默认值为“true”
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-CertificateType
指定颁发者的证书类型。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Curve
指定证书密钥的椭圆曲线名称。
此参数的可接受值为:
- P-256
- P-384
- P-521
- P-256K
- SECP256K1
参数属性
| 类型: | String
|
| 默认值: | None |
| 接受的值: | P-256, P-384, P-521, P-256K, SECP256K1 |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-DefaultProfile
用于与 azure 通信的凭据、帐户、租户和订阅
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Disabled
指示证书策略已禁用。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-DnsName
指定证书中的 DNS 名称。 使用者可选名称(SAN)可以指定为 DNS 名称。
参数属性
参数集
DNSNames
| Position: | 1 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-Ekus
指定证书中的增强型密钥用法(EKU)。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-EmailAtNumberOfDaysBeforeExpiry
指定自动通知过程开始到期前的天数。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-EmailAtPercentageLifetime
指定通知的自动过程开始后的生存期百分比。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-IssuerName
指定证书的颁发者的名称。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | 0 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-KeyNotExportable
指示密钥不可导出。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-KeySize
指定证书的密钥大小。
此参数的可接受值为:
- 2048
- 3072
- 4096
- 256
- 384
- 521
参数属性
| 类型: | Int32
|
| 默认值: | None |
| 接受的值: | 2048, 3072, 4096, 256, 384, 521 |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-KeyType
指定支持证书的密钥的密钥类型。
此参数的可接受值为:
参数属性
| 类型: | String
|
| 默认值: | RSA |
| 接受的值: | RSA, RSA-HSM, EC, EC-HSM |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-KeyUsage
指定证书中的密钥用法。
参数属性
| 类型: | List<T>[X509KeyUsageFlags]
|
| 默认值: | None |
| 接受的值: | None, EncipherOnly, CrlSign, KeyCertSign, KeyAgreement, DataEncipherment, KeyEncipherment, NonRepudiation, DigitalSignature, DecipherOnly |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-RenewAtNumberOfDaysBeforeExpiry
指定到期前的天数,之后证书续订的自动过程开始。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-RenewAtPercentageLifetime
指定证书续订的自动过程开始后的生存期百分比。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ReuseKeyOnRenewal
指示证书在续订期间重复使用密钥。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-SecretContentType
指定新密钥保管库机密的内容类型。
此参数的可接受值为:
- application/x-pkcs12
- application/x-pem-file
参数属性
| 类型: | String
|
| 默认值: | None |
| 接受的值: | application/x-pkcs12, application/x-pem-file |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-SubjectName
指定证书的使用者名称。
注释
如果必须在参数中的 SubjectName 属性中使用逗号(,)或句点(.),则必须将属性字段括在引号中。 例如,可以在“组织名称”字段中使用 O=“Contoso, Ltd.”。
参数属性
| 类型: | String
|
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
参数集
SubjectName
| Position: | 1 |
| 必需: | True |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-ValidityInMonths
指定证书有效的月数。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-WhatIf
显示 cmdlet 运行时会发生什么情况。
命令脚本未运行。
参数属性
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。
输出