diff --git a/src/KeyVault/KeyVault/Az.KeyVault.psd1 b/src/KeyVault/KeyVault/Az.KeyVault.psd1
index b1e6dd5b6c3a..28a11c9c1559 100644
--- a/src/KeyVault/KeyVault/Az.KeyVault.psd1
+++ b/src/KeyVault/KeyVault/Az.KeyVault.psd1
@@ -72,7 +72,7 @@ TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = 'KeyVault.Autorest/Az.KeyVault.format.ps1xml',
- 'KeyVault.format.ps1xml'
+ 'KeyVault.format.ps1xml', 'keyvault.generated.format.ps1xml'
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
NestedModules = @('./Az.KeyVault.Extension',
diff --git a/src/KeyVault/KeyVault/ChangeLog.md b/src/KeyVault/KeyVault/ChangeLog.md
index dff671f33ce1..f1024d9be2f6 100644
--- a/src/KeyVault/KeyVault/ChangeLog.md
+++ b/src/KeyVault/KeyVault/ChangeLog.md
@@ -18,6 +18,14 @@
- Additional information about change #1
-->
## Upcoming Release
+* Added parameter `ByteArrayValue` in `Invoke-AzKeyVaultKeyOperation` to support operating byte array without conversion to secure string.
+* Added Property `RawResult` in the output type `PSKeyOperationResult` of `Invoke-AzKeyVaultKeyOperation`.
+* [Upcoming Breaking Change] Added breaking change warning message for parameter `Value` in `Invoke-AzKeyVaultKeyOperation`.
+ - Parameter `Value` is expected to be removed in Az.KeyVault 6.0.0
+ - `ByteArrayValue` is the alternative of parameter `Value` in byte array format
+* [Upcoming Breaking Change] Added breaking change warning message for the output type `PSKeyOperationResult` of `Invoke-AzKeyVaultKeyOperation`.
+ - Property `Result` is expected to be removed in Az.KeyVault 6.0.0
+ - Property `RawResult` is the alternative of parameter `Result` in byte array format
## Version 5.0.1
* Removed redundant Microsoft Graph API calls for access policy in `Get-AzKeyVault`.
diff --git a/src/KeyVault/KeyVault/Commands/Key/InvokeAzureKeyVaultKeyOperation.cs b/src/KeyVault/KeyVault/Commands/Key/InvokeAzureKeyVaultKeyOperation.cs
index 7b2cf3ad2d73..88b7f2877c2c 100644
--- a/src/KeyVault/KeyVault/Commands/Key/InvokeAzureKeyVaultKeyOperation.cs
+++ b/src/KeyVault/KeyVault/Commands/Key/InvokeAzureKeyVaultKeyOperation.cs
@@ -1,7 +1,11 @@
-using Microsoft.Azure.Commands.KeyVault.Models;
+using Microsoft.Azure.Commands.Common.Exceptions;
+using Microsoft.Azure.Commands.KeyVault.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
+using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
+using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
+using System.Collections;
using System.Management.Automation;
using System.Security;
using System.Text;
@@ -14,6 +18,7 @@ namespace Microsoft.Azure.Commands.KeyVault.Commands.Key
/// 3. Wraps a symmetric key using a specified key.
/// 4. Unwraps a symmetric key using the specified key that was initially used for wrapping that key.
///
+ [CmdletOutputBreakingChangeWithVersion(typeof(PSKeyOperationResult), "12.0.0", "6.0.0", DeprecatedOutputProperties = new string[] { "Result" }, NewOutputProperties = new string[] { "RawResult" })]
[Cmdlet(VerbsLifecycle.Invoke, ResourceManager.Common.AzureRMConstants.AzurePrefix + "KeyVaultKeyOperation", SupportsShouldProcess = true, DefaultParameterSetName = ByVaultNameParameterSet)]
[OutputType(typeof(PSKeyOperationResult))]
public class InvokeAzureKeyVaultKeyOperation : KeyVaultKeyCmdletBase
@@ -52,51 +57,89 @@ enum Operations
[Alias("EncryptionAlgorithm", "WrapAlgorithm")]
public string Algorithm { get; set; }
- [Parameter(Mandatory = true,
- HelpMessage = "The value to be operated")]
+ [Parameter(Mandatory = false, HelpMessage = "The value to be operated. This parameter will be converted to byte array in UTF-8 encoding way. If your value can't be encoded by UTF-8, please use parameter ByteArrayValue as its alternative.")]
[ValidateNotNullOrEmpty]
+ [CmdletParameterBreakingChangeWithVersion(nameof(Value), "12.0.0", "6.0.0", ReplaceMentCmdletParameterName = nameof(ByteArrayValue))]
public SecureString Value { get; set; }
+
+ [Parameter(Mandatory = false, HelpMessage = "The value to be operated in byte array format.")]
+ [ValidateNotNullOrEmpty]
+ public byte[] ByteArrayValue { get; set; }
+
#endregion Input Parameter Definitions
+ private Operations opt = Operations.Unknown;
+
+ internal void ValidateParameters()
+ {
+ if (this.IsParameterBound(c => c.Value) && this.IsParameterBound(c => c.ByteArrayValue))
+ {
+ throw new AzPSArgumentException(string.Format("Please provide only one of parameter Value and ByteArrayValue"), nameof(ByteArrayValue));
+ }
+ else if (!this.IsParameterBound(c => c.Value) && !this.IsParameterBound(c => c.ByteArrayValue))
+ {
+ throw new AzPSArgumentException(string.Format("Must provide one of parameter Value and ByteArrayValue"), nameof(ByteArrayValue));
+ }
+ }
+
internal override void NormalizeParameterSets()
{
+
if (InputObject != null)
{
Version = Version ?? InputObject.Version;
}
+
+ Enum.TryParse(Operation, out opt);
+
+ if (this.IsParameterBound(c => c.Value))
+ {
+ switch (opt)
+ {
+ case Operations.Encrypt:
+ ByteArrayValue = Encoding.UTF8.GetBytes(Value.ConvertToString());
+ break;
+ case Operations.Decrypt:
+ ByteArrayValue = Convert.FromBase64String(Value.ConvertToString());
+ break;
+ case Operations.Wrap:
+ ByteArrayValue = Encoding.UTF8.GetBytes(Value.ConvertToString());
+ break;
+ case Operations.Unwrap:
+ ByteArrayValue = Convert.FromBase64String(Value.ConvertToString());
+ break;
+ default:
+ throw new NotSupportedException("Not supported ${Operation} yet");
+ }
+ }
+
base.NormalizeParameterSets();
}
public override void ExecuteCmdlet()
{
+ ValidateParameters();
NormalizeParameterSets();
- Operations opt = Operations.Unknown;
- Enum.TryParse(Operation, out opt);
-
if (string.IsNullOrEmpty(HsmName))
{
switch (opt)
{
case Operations.Encrypt:
this.WriteObject(
- this.Track2DataClient.Encrypt(VaultName, Name, Version,
- Encoding.UTF8.GetBytes(Value.ConvertToString()), Algorithm));
+ this.Track2DataClient.Encrypt(VaultName, Name, Version, ByteArrayValue, Algorithm));
break;
case Operations.Decrypt:
this.WriteObject(
- this.Track2DataClient.Decrypt(VaultName, Name, Version,
- Convert.FromBase64String(Value.ConvertToString()), Algorithm));
+ this.Track2DataClient.Decrypt(VaultName, Name, Version, ByteArrayValue, Algorithm));
break;
case Operations.Wrap:
this.WriteObject(
- this.Track2DataClient.WrapKey(VaultName, Name, Version,
- Encoding.UTF8.GetBytes(Value.ConvertToString()), Algorithm));
+ this.Track2DataClient.WrapKey(VaultName, Name, Version, ByteArrayValue, Algorithm));
break;
case Operations.Unwrap:
this.WriteObject(
- this.Track2DataClient.UnwrapKey(VaultName, Name, Version,
- Convert.FromBase64String(Value.ConvertToString()), Algorithm));
+ this.Track2DataClient.UnwrapKey(VaultName, Name, Version, ByteArrayValue, Algorithm));
break;
case Operations.Unknown:
throw new NotSupportedException("Not supported ${Operation} yet");
@@ -108,23 +151,19 @@ public override void ExecuteCmdlet()
{
case Operations.Encrypt:
this.WriteObject(
- this.Track2DataClient.ManagedHsmKeyEncrypt(HsmName, Name, Version,
- Encoding.UTF8.GetBytes(Value.ConvertToString()), Algorithm));
+ this.Track2DataClient.ManagedHsmKeyEncrypt(HsmName, Name, Version, ByteArrayValue, Algorithm));
break;
case Operations.Decrypt:
this.WriteObject(
- this.Track2DataClient.ManagedHsmKeyDecrypt(HsmName, Name, Version,
- Convert.FromBase64String(Value.ConvertToString()), Algorithm));
+ this.Track2DataClient.ManagedHsmKeyDecrypt(HsmName, Name, Version, ByteArrayValue, Algorithm));
break;
case Operations.Wrap:
this.WriteObject(
- this.Track2DataClient.ManagedHsmWrapKey(HsmName, Name, Version,
- Encoding.UTF8.GetBytes(Value.ConvertToString()), Algorithm));
+ this.Track2DataClient.ManagedHsmWrapKey(HsmName, Name, Version, ByteArrayValue, Algorithm));
break;
case Operations.Unwrap:
this.WriteObject(
- this.Track2DataClient.ManagedHsmUnwrapKey(HsmName, Name, Version,
- Convert.FromBase64String(Value.ConvertToString()), Algorithm));
+ this.Track2DataClient.ManagedHsmUnwrapKey(HsmName, Name, Version, ByteArrayValue, Algorithm));
break;
case Operations.Unknown:
throw new NotSupportedException("Not supported ${Operation} yet");
diff --git a/src/KeyVault/KeyVault/Models/Key/PSKeyOperationResult.cs b/src/KeyVault/KeyVault/Models/Key/PSKeyOperationResult.cs
index af9198b17d23..18c2f44fcd38 100644
--- a/src/KeyVault/KeyVault/Models/Key/PSKeyOperationResult.cs
+++ b/src/KeyVault/KeyVault/Models/Key/PSKeyOperationResult.cs
@@ -1,5 +1,7 @@
using Azure.Security.KeyVault.Keys.Cryptography;
+using Microsoft.WindowsAzure.Commands.Common.Attributes;
+
namespace Microsoft.Azure.Commands.KeyVault.Models
{
///
@@ -7,18 +9,31 @@ namespace Microsoft.Azure.Commands.KeyVault.Models
///
public class PSKeyOperationResult
{
+
// Summary: Key identifier
+ [Ps1Xml(Target = ViewControl.List, Label = nameof(KeyId), Position = 0)]
public string KeyId { get; }
+ ///
+ /// If operation is Wrap, the value is wrapped key
+ /// If operation is Unwrap, the value is unwrapped key
+ /// If operation is Encrypt, the value is encryted data
+ /// If operation is Decrypt, the value is decrypted data
+ ///
+ [Ps1Xml(Target = ViewControl.List, Label = nameof(RawResult), Position = 1)]
+ public byte[] RawResult { get; }
+
// Summary: encryted result or wraped result is base64 format. decryted result or unwraped result is plain text
public string Result { get; }
// Summary: Algorithm used.
+ [Ps1Xml(Target = ViewControl.List, Label = nameof(Algorithm), Position = 2)]
public string Algorithm { get; }
public PSKeyOperationResult(WrapResult wrapResult)
{
this.KeyId = wrapResult.KeyId;
+ this.RawResult = wrapResult.EncryptedKey;
this.Result = System.Convert.ToBase64String(wrapResult.EncryptedKey);
this.Algorithm = wrapResult.Algorithm.ToString();
}
@@ -26,6 +41,7 @@ public PSKeyOperationResult(WrapResult wrapResult)
public PSKeyOperationResult(UnwrapResult unwrapResult)
{
this.KeyId = unwrapResult.KeyId;
+ this.RawResult = unwrapResult.Key;
this.Result = System.Text.Encoding.UTF8.GetString(unwrapResult.Key);
this.Algorithm = unwrapResult.Algorithm.ToString();
}
@@ -33,6 +49,7 @@ public PSKeyOperationResult(UnwrapResult unwrapResult)
public PSKeyOperationResult(EncryptResult encryptResult)
{
this.KeyId = encryptResult.KeyId;
+ this.RawResult = encryptResult.Ciphertext;
this.Result = System.Convert.ToBase64String(encryptResult.Ciphertext);
this.Algorithm = encryptResult.Algorithm.ToString();
}
@@ -40,6 +57,7 @@ public PSKeyOperationResult(EncryptResult encryptResult)
public PSKeyOperationResult(DecryptResult decryptResult)
{
this.KeyId = decryptResult.KeyId;
+ this.RawResult = decryptResult.Plaintext;
this.Result = System.Text.Encoding.UTF8.GetString(decryptResult.Plaintext);
this.Algorithm = decryptResult.Algorithm.ToString();
}
diff --git a/src/KeyVault/KeyVault/help/Invoke-AzKeyVaultKeyOperation.md b/src/KeyVault/KeyVault/help/Invoke-AzKeyVaultKeyOperation.md
index f399fd24f909..068ac8d9723d 100644
--- a/src/KeyVault/KeyVault/help/Invoke-AzKeyVaultKeyOperation.md
+++ b/src/KeyVault/KeyVault/help/Invoke-AzKeyVaultKeyOperation.md
@@ -14,23 +14,23 @@ Performs operation like "Encrypt", "Decrypt", "Wrap" or "Unwrap" using a specifi
### ByVaultName (Default)
```
-Invoke-AzKeyVaultKeyOperation [-Version ] -Operation -Algorithm -Value
- [-Name] [-VaultName] [-DefaultProfile ] [-WhatIf] [-Confirm]
- []
+Invoke-AzKeyVaultKeyOperation [-Version ] -Operation -Algorithm
+ [-Value ] [-ByteArrayValue ] [-Name] [-VaultName]
+ [-DefaultProfile ] [-WhatIf] [-Confirm] []
```
### ByHsmName
```
-Invoke-AzKeyVaultKeyOperation [-Version ] -Operation -Algorithm -Value
- [-HsmName] [-Name] [-DefaultProfile ] [-WhatIf] [-Confirm]
- []
+Invoke-AzKeyVaultKeyOperation [-Version ] -Operation -Algorithm
+ [-Value ] [-ByteArrayValue ] [-HsmName] [-Name]
+ [-DefaultProfile ] [-WhatIf] [-Confirm] []
```
### ByKeyInputObject
```
-Invoke-AzKeyVaultKeyOperation [-Version ] -Operation -Algorithm -Value
- [-InputObject] [-DefaultProfile ] [-WhatIf] [-Confirm]
- []
+Invoke-AzKeyVaultKeyOperation [-Version ] -Operation -Algorithm
+ [-Value ] [-ByteArrayValue ] [-InputObject]
+ [-DefaultProfile ] [-WhatIf] [-Confirm] []
```
## DESCRIPTION
@@ -41,65 +41,86 @@ Invoke-AzKeyVaultKeyOperation cmdlet supports
4. Unwrapping a symmetric key using the specified key that was initially used for wrapping that key.
## EXAMPLES
+### Example 1: Encrypts byte array using an encryption key
+```powershell
+$byteArray = [Byte[]]@(58, 219)
+$encryptedData = Invoke-AzKeyVaultKeyOperation -Operation Encrypt -Algorithm RSA1_5 -VaultName test-kv -Name test-key -ByteArrayValue $byteArray
+$encryptedData
+```
+
+```output
+KeyId : https://bez-kv.vault.azure.net/keys/bez-key/c96ce0fb18de446c9f4b911b686988af
+RawResult : {21, 39, 82, 56…}
+Algorithm : RSA1_5
+```
-### Example 1: Encrypts using an encryption key
+Encrypts `$byteArray` using test-key stored in test-kv.
+
+### Example 2: Decrypts byte array using an encryption key
```powershell
-$result = Invoke-AzKeyVaultKeyOperation -Operation Encrypt -Algorithm RSA1_5 -VaultName test-kv -Name test-key -Value (ConvertTo-SecureString -String "test" -AsPlainText -Force)
-$result | Format-List
+$decryptedData = Invoke-AzKeyVaultKeyOperation -Operation Decrypt -Algorithm RSA1_5 -VaultName test-kv -Name test-key -ByteArrayValue $encryptedData.RawResult
+$decryptedData
```
```output
-KeyId : https://test-kv.vault.azure.net/keys/test-key/bd8b77352a2443d4983bd70e9f660bc6
-Result : iVlA6rHicEm6F9vtU3jARzxWughOcRK9htj4UMy0ijd4a4hHwYrSy4lSXhiQTKSMpX+Qv3NTaz/fKNWdSoudCAwv2ZX/pYlSqZmDoAHzjUc
- 4wDQAAVZAUvOxHcpCQf3CrlvQK3XfsZeddeiD9laiUU3iB2Ivh3trX0G/Y29gL54THKsmlwXh5mBhxcXHaUv0erDzEVAGnC73FHlJoHCTdm
- 7eUMWvsnfhtd/BhcuBb/CeMy1QzHgoBTrByWms4KsTODBEZt41aVkdYxJDREsC8X6a/1vp9EeV+7jm3sZLl+Dm7XOpUjbR+/BUU7HKaw09i
- BRQJGhXf7oyZOf3g6EPEQ==
+KeyId : https://bez-kv.vault.azure.net/keys/bez-key/c96ce0fb18de446c9f4b911b686988af
+RawResult : {58, 219}
Algorithm : RSA1_5
```
-Encrypts string "test" using test-key stored in test-kv. The `Result` is encrypted result in Base64 string format.
+Decrypts `$encryptedData.RawResult` using test-key stored in test-kv. The `$decryptedData.RawResult` is same with `$byteArray`, which is original data.
-### Example 2: Decrypt encrypted data
+### Example 3: Encrypts plain text using an encryption key
```powershell
-$result
-$result = Invoke-AzKeyVaultKeyOperation -Operation Decrypt -Algorithm RSA1_5 -VaultName test-kv -Name test-key -Value (ConvertTo-SecureString -String $result.Result -AsPlainText -Force)
-$result | Format-List
+$encryptedData = Invoke-AzKeyVaultKeyOperation -Operation Encrypt -Algorithm RSA1_5 -VaultName test-kv -Name test-key -Value (ConvertTo-SecureString -String "test" -AsPlainText -Force)
+$encryptedData
```
```output
KeyId : https://test-kv.vault.azure.net/keys/test-key/bd8b77352a2443d4983bd70e9f660bc6
-Result : test
+RawResult : {58, 219, 6, 236…}
Algorithm : RSA1_5
```
-Decrypts encrypted data that is encrypted using test-key stored in test-kv. The `Result` is a plain string.
+Encrypts string "test" using test-key stored in test-kv. The `RawResult` is the encrypted result in byte array format, where [System.Convert]::ToBase64String($encryptedData.RawResult) equals $encryptedData.Result.
-### Example 3: Wraps a symmetric key using a specified key
+### Example 4: Decrypt encrypted data to plain text
```powershell
-$result = Invoke-AzKeyVaultKeyOperation -Operation Wrap -Algorithm RSA1_5 -VaultName test-kv -Name test-key -Value (ConvertTo-SecureString -String "ovQIlbB0DgWhZA7sgkPxbg9H-Ly-VlNGPSgGrrZvlIo" -AsPlainText -Force)
+$decryptedData = Invoke-AzKeyVaultKeyOperation -Operation Decrypt -Algorithm RSA1_5 -VaultName test-kv -Name test-key -ByteArrayValue $encryptedData.RawResult
+$decryptedData
+```
-$result | Format-List
+```output
+KeyId : https://bez-kv.vault.azure.net/keys/bez-key/c96ce0fb18de446c9f4b911b686988af
+RawResult : $byteArray
+Algorithm : RSA1_5
+```
+
+Decrypts encrypted data that is encrypted using test-key stored in test-kv. The `$decryptedData.Result` is `test`. The `RawResult` is the decrypted result in byte array format, where [System.Text.UTF8Encoding]::UTF8.GetString($decryptedData.RawResult) equals $decryptedData.Result.
+
+### Example 5: Wraps a symmetric key using a specified key
+```powershell
+$wrappedResult = Invoke-AzKeyVaultKeyOperation -Operation Wrap -Algorithm RSA1_5 -VaultName test-kv -Name test-key -Value (ConvertTo-SecureString -String "ovQIlbB0DgWhZA7sgkPxbg9H-Ly-VlNGPSgGrrZvlIo" -AsPlainText -Force)
+
+$wrappedResult | Format-List
```
```output
KeyId : https://test-kv.vault.azure.net/keys/test-key/375cdf20252043b79c8ca0c57b6c7679
-Result : imHceWcmB5jufcz+qS+HwaXOvPiaeOQ2dF1Bh+2DByuw+AOyoL3wtwDSilP5BlR3DAB3byj4hlUqkEKcoHJpOGnU53mWeV0yhL+Wx0O4T9n
- +e54Gtv/sfJD0CcMg+89mssi7hgU0u1IaaowzgSmP7ViRrSVGu8FniAR6hdf7j0JL7ON8IIFMy/+7yq00aJs/dspcESGjcZDry5pLzYphel
- x7VAEbjuv1TuiHwu8cJYH/GsvROErOQbQ+aKcKlYTMzZRGdCA07xXltvFrTiCIvzeKE/lTJVIHH/Nv4aRne/ENRC2cx92r9XFhEBID6o5Td
- kN09Wdjejo8nLDRw9XbtQ==
+RawResult : {58, 219, 6, 236…}
Algorithm : RSA1_5
```
Wraps a symmetric key using key named test-key stored in test-kv. The `Result` is wrapped result in Base64 string format.
-### Example 4: Unwraps a symmetric key using a specified key
+### Example 6: Unwraps a symmetric key using a specified key
```powershell
Invoke-AzKeyVaultKeyOperation -Operation Unwrap -Algorithm RSA1_5 -VaultName test-kv -Name test-key -Value (ConvertTo-SecureString -String $result.Result -AsPlainText -Force)
```
```output
KeyId : https://test-kv.vault.azure.net/keys/test-key/375cdf20252043b79c8ca0c57b6c7679
-Result : ovQIlbB0DgWhZA7sgkPxbg9H-Ly-VlNGPSgGrrZvlIo
+RawResult : {58, 219, 6, 236…}
Algorithm : RSA1_5
```
@@ -111,7 +132,7 @@ Unwraps a symmetric key using a specified key test-key stored in test-kv. The `R
Algorithm identifier
```yaml
-Type: System.String
+Type: String
Parameter Sets: (All)
Aliases: EncryptionAlgorithm, WrapAlgorithm
@@ -122,11 +143,41 @@ Accept pipeline input: False
Accept wildcard characters: False
```
+### -ByteArrayValue
+The value to be operated in byte array format.
+
+```yaml
+Type: Byte[]
+Parameter Sets: (All)
+Aliases:
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
+### -Confirm
+Prompts you for confirmation before running the cmdlet.
+
+```yaml
+Type: SwitchParameter
+Parameter Sets: (All)
+Aliases: cf
+
+Required: False
+Position: Named
+Default value: None
+Accept pipeline input: False
+Accept wildcard characters: False
+```
+
### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
```yaml
-Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer
+Type: IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential
@@ -141,7 +192,7 @@ Accept wildcard characters: False
HSM name.
```yaml
-Type: System.String
+Type: String
Parameter Sets: ByHsmName
Aliases:
@@ -156,7 +207,7 @@ Accept wildcard characters: False
Key object
```yaml
-Type: Microsoft.Azure.Commands.KeyVault.Models.PSKeyVaultKeyIdentityItem
+Type: PSKeyVaultKeyIdentityItem
Parameter Sets: ByKeyInputObject
Aliases: Key
@@ -171,7 +222,7 @@ Accept wildcard characters: False
Key name.
```yaml
-Type: System.String
+Type: String
Parameter Sets: ByVaultName, ByHsmName
Aliases: KeyName
@@ -186,7 +237,7 @@ Accept wildcard characters: False
Algorithm identifier
```yaml
-Type: System.String
+Type: String
Parameter Sets: (All)
Aliases:
@@ -198,14 +249,14 @@ Accept wildcard characters: False
```
### -Value
-The value to be operated
+The value to be operated. This parameter will be converted to byte array in UTF-8 encoding way. If your value can't be encoded by UTF-8, please use parameter ByteArrayValue as its alternative.
```yaml
-Type: System.Security.SecureString
+Type: SecureString
Parameter Sets: (All)
Aliases:
-Required: True
+Required: False
Position: Named
Default value: None
Accept pipeline input: False
@@ -216,7 +267,7 @@ Accept wildcard characters: False
Vault name.
```yaml
-Type: System.String
+Type: String
Parameter Sets: ByVaultName
Aliases:
@@ -231,7 +282,7 @@ Accept wildcard characters: False
Key version.
```yaml
-Type: System.String
+Type: String
Parameter Sets: (All)
Aliases: KeyVersion
@@ -242,27 +293,12 @@ Accept pipeline input: False
Accept wildcard characters: False
```
-### -Confirm
-Prompts you for confirmation before running the cmdlet.
-
-```yaml
-Type: System.Management.Automation.SwitchParameter
-Parameter Sets: (All)
-Aliases: cf
-
-Required: False
-Position: Named
-Default value: None
-Accept pipeline input: False
-Accept wildcard characters: False
-```
-
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
```yaml
-Type: System.Management.Automation.SwitchParameter
+Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
diff --git a/src/KeyVault/KeyVault/keyvault.generated.format.ps1xml b/src/KeyVault/KeyVault/keyvault.generated.format.ps1xml
new file mode 100644
index 000000000000..d0649341d674
--- /dev/null
+++ b/src/KeyVault/KeyVault/keyvault.generated.format.ps1xml
@@ -0,0 +1,31 @@
+
+
+
+
+ Microsoft.Azure.Commands.KeyVault.Models.PSKeyOperationResult
+
+ Microsoft.Azure.Commands.KeyVault.Models.PSKeyOperationResult
+
+
+
+
+
+
+ KeyId
+
+
+
+ RawResult
+
+
+
+ Algorithm
+
+
+
+
+
+
+
+
+
\ No newline at end of file