@@ -79,6 +79,46 @@ The first command uses the ConvertTo-SecureString cmdlet to create a secure pass
79
79
stores it in the $Password variable.
80
80
The second command imports the certificate named ImportCert01 into the CosotosoKV01 key vault.
81
81
82
+ ### Example 2: Import a key vault certificate by CertificateString
83
+ ``` powershell
84
+ $Password = ConvertTo-SecureString -String "123" -AsPlainText -Force
85
+ $Base64String = [System.Convert]::ToBase64String([System.IO.File]::ReadAllBytes("import.pfx"))
86
+ Import-AzKeyVaultCertificate -VaultName "ContosoKV01" -Name "ImportCert01" -CertificateString $Base64String -Password $Password
87
+
88
+ ```
89
+
90
+ ``` output
91
+ Name : importCert01
92
+ Certificate : [Subject]
93
+ CN=contoso.com
94
+
95
+ [Issuer]
96
+ CN=contoso.com
97
+
98
+ [Serial Number]
99
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
100
+
101
+ [Not Before]
102
+ 2/8/2016 3:11:45 PM
103
+
104
+ [Not After]
105
+ 8/8/2016 4:21:45 PM
106
+
107
+ [Thumbprint]
108
+ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
109
+
110
+ Thumbprint : XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
111
+ Tags :
112
+ Enabled : True
113
+ Created : 2/8/2016 11:50:43 PM
114
+ Updated : 2/8/2016 11:50:43 PM
115
+ ```
116
+
117
+ The first command uses the ConvertTo-SecureString cmdlet to create a secure password, and then
118
+ stores it in the $Password variable.
119
+ The second command reads a certificate as a Base64 encoded representation.
120
+ The third command imports the certificate named ImportCert01 into the CosotosoKV01 key vault.
121
+
82
122
## PARAMETERS
83
123
84
124
### -CertificateCollection
@@ -256,4 +296,4 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
256
296
257
297
[Remove-AzKeyVaultCertificate](./Remove-AzKeyVaultCertificate.md)
258
298
259
- [Creating and merging CSR in Key Vault](https://docs.microsoft.com/azure/key-vault/certificates/create-certificate-signing-request)
299
+ [Creating and merging CSR in Key Vault](https://docs.microsoft.com/azure/key-vault/certificates/create-certificate-signing-request)
0 commit comments