共用方式為


New-AzureKeyVaultCertificatePolicy

建立記憶體內部憑證原則物件。

警告

自 2024 年 2 月 29 日起,AzureRM PowerShell 模組已正式淘汰。 建議使用者從 AzureRM 遷移至 Az PowerShell 模組,以確保持續支援和更新。

雖然 AzureRM 模組可能仍可運作,但不再維護或支援它,但會根據用戶的判斷權和風險放置任何繼續使用。 如需轉換至 Az 模組的指引,請參閱我們的 移轉資源

Syntax

New-AzureKeyVaultCertificatePolicy
   [-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>]
   [-KeyNotExportable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzureKeyVaultCertificatePolicy
   [-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>]
   [-KeyNotExportable]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

New-AzureKeyVaultCertificatePolicy Cmdlet 會為 Azure 金鑰保存庫 建立記憶體內部憑證原則物件。

範例

範例 1:建立憑證原則

PS C:\> New-AzureKeyVaultCertificatePolicy -SecretContentType "application/x-pkcs12" -SubjectName "CN=contoso.com" -IssuerName "Self" -ValidityInMonths 6 -ReuseKeyOnRenewal

SecretContentType               : application/x-pkcs12
Kty                             :
KeySize                         : 2048
Exportable                      :
ReuseKeyOnRenewal               : True
SubjectName                     : CN=contoso.com
DnsNames                        :
KeyUsage                        :
Ekus                            :
ValidityInMonths                : 6
IssuerName                      : Self
CertificateType                 :
RenewAtNumberOfDaysBeforeExpiry :
RenewAtPercentageLifetime       :
EmailAtNumberOfDaysBeforeExpiry :
EmailAtPercentageLifetime       :
CertificateTransparency         :
Enabled                         : True
Created                         :
Updated                         :

此命令會建立有效六個月的憑證原則,並重複使用密鑰來更新憑證。

參數

-CertificateType

指定簽發者的憑證類型。

類型:String
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
Aliases:cf
Position:Named
預設值:None
必要:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶

類型:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
Accept pipeline input:False
Accept wildcard characters:False

-Disabled

表示憑證原則已停用。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-DnsName

指定憑證中的 DNS 名稱。

類型:List<T>[String]
Aliases:DnsNames
Position:1
預設值:None
必要:True
Accept pipeline input:True
Accept wildcard characters:False

-Ekus

指定憑證中的增強金鑰使用方式 (EKU)。

類型:List<T>[String]
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-EmailAtNumberOfDaysBeforeExpiry

指定自動通知程式開始到期前多少天。

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-EmailAtPercentageLifetime

指定存留期的百分比,之後通知的自動程式就會開始。

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-IssuerName

指定憑證的簽發者名稱。

類型:String
Position:0
預設值:None
必要:True
Accept pipeline input:True
Accept wildcard characters:False

-KeyNotExportable

表示金鑰無法匯出。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-KeyType

指定備份憑證之金鑰的金鑰類型。 此參數可接受的值為:

  • RSA
  • RSA-HSM
類型:String
接受的值:RSA, RSA-HSM
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-KeyUsage

指定憑證中的金鑰使用方式。

類型:List<T>[X509KeyUsageFlags]
接受的值:None, EncipherOnly, CrlSign, KeyCertSign, KeyAgreement, DataEncipherment, KeyEncipherment, NonRepudiation, DigitalSignature, DecipherOnly
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-RenewAtNumberOfDaysBeforeExpiry

指定到期前的天數,之後憑證更新的自動程式就會開始。

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-RenewAtPercentageLifetime

指定存留期的百分比,之後憑證更新的自動程式就會開始。

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-ReuseKeyOnRenewal

表示憑證在更新期間重複使用密鑰。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-SecretContentType

指定新金鑰保存庫秘密的內容類型。 此參數可接受的值為:

  • application/x-pkcs12
  • application/x-pem-file
類型:String
接受的值:application/x-pkcs12, application/x-pem-file
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-SubjectName

指定憑證的主體名稱。

類型:String
Position:1
預設值:None
必要:True
Accept pipeline input:True
Accept wildcard characters:False

-ValidityInMonths

指定憑證有效的月數。

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:False
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
Aliases:wi
Position:Named
預設值:None
必要:False
Accept pipeline input:False
Accept wildcard characters:False

輸入

String

List<T>[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Nullable<T>[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

SwitchParameter

List<T>[[System.Security.Cryptography.X509Certificates.X509KeyUsageFlags, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

輸出

PSKeyVaultCertificatePolicy