Get-AzKeyVaultCertificate
Mendapatkan sertifikat dari brankas kunci.
Sintaks
Get-AzKeyVaultCertificate
[-VaultName] <String>
[[-Name] <String>]
[-InRemovedState]
[-IncludePending]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzKeyVaultCertificate
[-VaultName] <String>
[-Name] <String>
[-Version] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzKeyVaultCertificate
[-VaultName] <String>
[-Name] <String>
[-IncludeVersions]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzKeyVaultCertificate
[-InputObject] <PSKeyVault>
[[-Name] <String>]
[-InRemovedState]
[-IncludePending]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzKeyVaultCertificate
[-InputObject] <PSKeyVault>
[-Name] <String>
[-Version] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzKeyVaultCertificate
[-InputObject] <PSKeyVault>
[-Name] <String>
[-IncludeVersions]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzKeyVaultCertificate
[-ResourceId] <String>
[[-Name] <String>]
[-InRemovedState]
[-IncludePending]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzKeyVaultCertificate
[-ResourceId] <String>
[-Name] <String>
[-Version] <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzKeyVaultCertificate
[-ResourceId] <String>
[-Name] <String>
[-IncludeVersions]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Deskripsi
Cmdlet Get-AzKeyVaultCertificate mendapatkan sertifikat yang ditentukan atau versi sertifikat dari brankas kunci di Azure Key Vault.
Contoh
Contoh 1: Mendapatkan sertifikat
Get-AzKeyVaultCertificate -VaultName "ContosoKV01" -Name "TestCert01"
Name : testCert01
Certificate : [Subject]
CN=contoso.com
[Issuer]
CN=contoso.com
[Serial Number]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Not Before]
2/8/2016 3:11:45 PM
[Not After]
8/8/2016 4:21:45 PM
[Thumbprint]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
KeyId : https://contoso.vault.azure.net:443/keys/TestCert01/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
SecretId : https://contoso.vault.azure.net:443/secrets/TestCert01/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Thumbprint : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Tags :
Enabled : True
Created : 2/8/2016 11:21:45 PM
Updated : 2/8/2016 11:21:45 PM
Contoh 2: Dapatkan sertifikasi dan simpan sebagai pfx
Perintah ini mendapatkan sertifikat bernama TestCert01 dari brankas kunci bernama ContosoKV01. Untuk mengunduh sertifikat sebagai file pfx, jalankan perintah berikut. Perintah ini mengakses SecretId lalu menyimpan konten sebagai file pfx.
$cert = Get-AzKeyVaultCertificate -VaultName $vaultName -Name $certName
$secret = Get-AzKeyVaultSecret -VaultName $vaultName -Name $cert.Name
$secretByte = [Convert]::FromBase64String(($secret.SecretValue | ConvertFrom-SecureString -AsPlainText))
# Write to a file
[System.IO.File]::WriteAllBytes("cert.pfx", $secretByte)
Contoh 3: Dapatkan semua sertifikat yang telah dihapus tetapi tidak dihapus menyeluruh untuk brankas kunci ini.
Get-AzKeyVaultCertificate -VaultName 'contoso' -InRemovedState
DeletedDate : 5/24/2018 6:08:32 PM
Enabled : True
Expires : 11/24/2018 6:08:13 PM
NotBefore : 5/24/2018 5:58:13 PM
Created : 5/24/2018 6:08:13 PM
Updated : 5/24/2018 6:08:13 PM
Tags :
VaultName : contoso
Name : test1
Version :
Id : https://contoso.vault.azure.net:443/certificates/test1
ScheduledPurgeDate : 8/22/2018 6:10:47 PM
DeletedDate : 5/24/2018 6:10:47 PM
Enabled : True
Expires : 11/24/2018 6:09:44 PM
NotBefore : 5/24/2018 5:59:44 PM
Created : 5/24/2018 6:09:44 PM
Updated : 5/24/2018 6:09:44 PM
Tags :
VaultName : contoso
Name : test2
Version :
Id : https://contoso.vault.azure.net:443/certificates/test2
Perintah ini mendapatkan semua sertifikat yang telah dihapus sebelumnya, tetapi tidak dihapus menyeluruh, di brankas kunci bernama Contoso.
Contoh 4: Mendapatkan sertifikat MyCert yang telah dihapus tetapi tidak dihapus menyeluruh untuk brankas kunci ini.
Get-AzKeyVaultCertificate -VaultName 'contoso' -Name 'test1' -InRemovedState
Certificate : [Subject]
CN=contoso.com
[Issuer]
CN=contoso.com
[Serial Number]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[Not Before]
5/24/2018 10:58:13 AM
[Not After]
11/24/2018 10:08:13 AM
[Thumbprint]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
KeyId : https://contoso.vault.azure.net:443/keys/test1/7fe415d5518240c1a6fce89986b8d334
SecretId : https://contoso.vault.azure.net:443/secrets/test1/7fe415d5518240c1a6fce89986b8d334
Thumbprint : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
RecoveryLevel : Recoverable+Purgeable
ScheduledPurgeDate : 8/22/2018 6:08:32 PM
DeletedDate : 5/24/2018 6:08:32 PM
Enabled : True
Expires : 11/24/2018 6:08:13 PM
NotBefore : 5/24/2018 5:58:13 PM
Created : 5/24/2018 6:08:13 PM
Updated : 5/24/2018 6:08:13 PM
Tags :
VaultName : contoso
Name : test1
Version : 7fe415d5518240c1a6fce89986b8d334
Id : https://contoso.vault.azure.net:443/certificates/test1/7fe415d5518240c1a6fce89986b8d334
Perintah ini mendapatkan sertifikat bernama 'MyCert' yang telah dihapus sebelumnya, tetapi tidak dihapus menyeluruh, di brankas kunci bernama Contoso. Perintah ini akan mengembalikan metadata seperti tanggal penghapusan, dan tanggal penghapusan terjadwal dari sertifikat yang dihapus ini.
Contoh 5: Mencantumkan sertifikat menggunakan pemfilteran
Get-AzKeyVaultCertificate -VaultName "ContosoKV01" -Name "test*"
Enabled : True
Expires : 8/5/2019 2:39:25 AM
NotBefore : 2/5/2019 2:29:25 AM
Created : 2/5/2019 2:39:25 AM
Updated : 2/5/2019 2:39:25 AM
Tags :
VaultName : ContosoKV01
Name : test1
Version :
Id : https://ContosoKV01.vault.azure.net:443/certificates/test1
Enabled : True
Expires : 8/5/2019 2:39:25 AM
NotBefore : 2/5/2019 2:29:25 AM
Created : 2/5/2019 2:39:25 AM
Updated : 2/5/2019 2:39:25 AM
Tags :
VaultName : ContosoKV01
Name : test2
Version :
Id : https://ContosoKV01.vault.azure.net:443/certificates/test2
Perintah ini mendapatkan semua sertifikat yang dimulai dengan "pengujian" dari brankas kunci bernama ContosoKV01.
Parameter
Kredensial, akun, penyewa, dan langganan yang digunakan untuk komunikasi dengan azure
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan apakah akan menyertakan sertifikat yang tertunda dalam output
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menunjukkan bahwa operasi ini mendapatkan semua versi sertifikat.
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Objek KeyVault.
| Type: | PSKeyVault |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Menentukan apakah akan menyertakan sertifikat yang dihapus sebelumnya dalam output
| Type: | SwitchParameter |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan nama sertifikat yang akan didapatkan.
| Type: | String |
| Aliases: | CertificateName |
| Position: | 1 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | True |
Id Sumber Daya KeyVault.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Menentukan nama brankas kunci.
| Type: | String |
| Position: | 0 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Menentukan versi sertifikat.
| Type: | String |
| Aliases: | CertificateVersion |
| Position: | 2 |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Input
Output
PSKeyVaultCertificateIdentityItem
PSDeletedKeyVaultCertificateIdentityItem
Link Terkait
Saran dan Komentar
Kirim dan lihat umpan balik untuk