diff --git a/src/VaultSharp/V1/SecretsEngines/Transit/CreateKeyRequestOptions.cs b/src/VaultSharp/V1/SecretsEngines/Transit/CreateKeyRequestOptions.cs
index cfb0ef46..9d488883 100644
--- a/src/VaultSharp/V1/SecretsEngines/Transit/CreateKeyRequestOptions.cs
+++ b/src/VaultSharp/V1/SecretsEngines/Transit/CreateKeyRequestOptions.cs
@@ -12,33 +12,38 @@ public class CreateKeyRequestOptions
/// ciphertext.This requires derived to be set to true. When enabled, each encryption(/decryption/rewrap/datakey)
/// operation will derive a nonce value rather than randomly generate it.
///
- [JsonProperty(PropertyName = "convergent_encryption", NullValueHandling = NullValueHandling.Ignore)]
- public bool? ConvergentEncryption { get; set; }
+ [JsonProperty(PropertyName = "convergent_encryption")]
+ public bool ConvergentEncryption { get; set; }
///
/// Specifies if key derivation is to be used.If enabled, all encrypt/decrypt requests to this named
/// key must provide a context which is used for key derivation.
///
- [JsonProperty(PropertyName = "derived", NullValueHandling = NullValueHandling.Ignore)]
- public bool? Derived { get; set; }
+ [JsonProperty(PropertyName = "derived")]
+ public bool Derived { get; set; }
///
/// Enables keys to be exportable. This allows for all the valid keys in the key ring to be
/// exported. Once set, this cannot be disabled.
///
- [JsonProperty(PropertyName = "exportable", NullValueHandling = NullValueHandling.Ignore)]
- public bool? Exportable { get; set; }
+ [JsonProperty(PropertyName = "exportable")]
+ public bool Exportable { get; set; }
///
/// If set, enables taking backup of named key in the plaintext format.Once set, this cannot be disabled.
///
- [JsonProperty(PropertyName = "allow_plaintext_backup", NullValueHandling = NullValueHandling.Ignore)]
- public bool? AllowPlaintextBackup { get; set; }
+ [JsonProperty(PropertyName = "allow_plaintext_backup")]
+ public bool AllowPlaintextBackup { get; set; }
///
/// Specifies the type of key to create.
///
[JsonProperty("type")]
- public string Type { get; set; } = "aes256-gcm96";
+ public TransitKeyType Type { get; set; }
+
+ public CreateKeyRequestOptions()
+ {
+ this.Type = TransitKeyType.aes256_gcm96;
+ }
}
}
\ No newline at end of file
diff --git a/src/VaultSharp/V1/SecretsEngines/Transit/EncryptionKeyInfo.cs b/src/VaultSharp/V1/SecretsEngines/Transit/EncryptionKeyInfo.cs
index f28fe9a0..143c7706 100644
--- a/src/VaultSharp/V1/SecretsEngines/Transit/EncryptionKeyInfo.cs
+++ b/src/VaultSharp/V1/SecretsEngines/Transit/EncryptionKeyInfo.cs
@@ -12,7 +12,7 @@ public class EncryptionKeyInfo
/// The type of key (i.e. encryption algorithm) to generate.
///
[JsonProperty("type")]
- public string Type { get; set; } = "aes256-gcm96";
+ public TransitKeyType Type { get; set; }
///
/// Specifies if the key is allowed to be deleted.
diff --git a/src/VaultSharp/V1/SecretsEngines/Transit/ITransitSecretsEngine.cs b/src/VaultSharp/V1/SecretsEngines/Transit/ITransitSecretsEngine.cs
index 7fac7d89..5f3ce873 100644
--- a/src/VaultSharp/V1/SecretsEngines/Transit/ITransitSecretsEngine.cs
+++ b/src/VaultSharp/V1/SecretsEngines/Transit/ITransitSecretsEngine.cs
@@ -114,7 +114,7 @@ public interface ITransitSecretsEngine
/// Provide a value only if you have customized the mount point.
///
/// Nothing is returned. No error means the operation was successful.
- Task CreateKeyAsync(string keyName, CreateKeyRequestOptions createKeyRequestOptions, string mountPoint = SecretsEngineDefaultPaths.Transit);
+ Task CreateEncryptionKeyAsync(string keyName, CreateKeyRequestOptions createKeyRequestOptions, string mountPoint = SecretsEngineDefaultPaths.Transit);
///
/// This endpoint returns information about a named encryption key.
@@ -143,7 +143,7 @@ public interface ITransitSecretsEngine
/// Provide a value only if you have customized the mount point.
///
/// Nothing is returned. No error means the operation was successful.
- Task UpdateKeyAsync(string keyName, UpdateKeyRequestOptions updateKeyRequestOptions, string mountPoint = SecretsEngineDefaultPaths.Transit);
+ Task UpdateEncryptionKeyConfigAsync(string keyName, UpdateKeyRequestOptions updateKeyRequestOptions, string mountPoint = SecretsEngineDefaultPaths.Transit);
///
/// This endpoint deletes a named encryption key. It will no longer be possible to decrypt any data encrypted with the named key.
@@ -156,7 +156,7 @@ public interface ITransitSecretsEngine
/// Provide a value only if you have customized the mount point.
///
/// Nothing is returned. No error means the operation was successful.
- Task DeleteKeyAsync(string keyName, string mountPoint = SecretsEngineDefaultPaths.Transit);
+ Task DeleteEncryptionKeyAsync(string keyName, string mountPoint = SecretsEngineDefaultPaths.Transit);
///
/// This endpoint rotates the version of the named key. After rotation, new plaintext requests will be encrypted with the new version of the key.
@@ -169,7 +169,7 @@ public interface ITransitSecretsEngine
/// Provide a value only if you have customized the mount point.
///
/// Nothing is returned. No error means the operation was successful.
- Task RotateKeyAsync(string keyName, string mountPoint = SecretsEngineDefaultPaths.Transit);
+ Task RotateEncryptionKeyAsync(string keyName, string mountPoint = SecretsEngineDefaultPaths.Transit);
///
/// This endpoint rewraps the provided ciphertext using the latest version of the named key.
diff --git a/src/VaultSharp/V1/SecretsEngines/Transit/RewrapRequestOptions.cs b/src/VaultSharp/V1/SecretsEngines/Transit/RewrapRequestOptions.cs
index aab12ed3..ab100aa9 100644
--- a/src/VaultSharp/V1/SecretsEngines/Transit/RewrapRequestOptions.cs
+++ b/src/VaultSharp/V1/SecretsEngines/Transit/RewrapRequestOptions.cs
@@ -11,13 +11,13 @@ public class RewrapRequestOptions : RewrapItem
///
/// Specifies the version of the key to use for the operation. If not set, uses the latest version.
///
- [JsonProperty(PropertyName = "key_version", NullValueHandling = NullValueHandling.Ignore)]
- public int? KeyVersion { get; set; }
+ [JsonProperty(PropertyName = "key_version")]
+ public int KeyVersion { get; set; }
///
/// Specifies a list of items to be decrypted in a single batch.
///
- [JsonProperty(PropertyName = "batch_input", NullValueHandling = NullValueHandling.Ignore)]
+ [JsonProperty(PropertyName = "batch_input")]
public List BatchedRewrapItems { get; set; }
}
}
\ No newline at end of file
diff --git a/src/VaultSharp/V1/SecretsEngines/Transit/TransitSecretsEngineProvider.cs b/src/VaultSharp/V1/SecretsEngines/Transit/TransitSecretsEngineProvider.cs
index cc330290..04388c4c 100644
--- a/src/VaultSharp/V1/SecretsEngines/Transit/TransitSecretsEngineProvider.cs
+++ b/src/VaultSharp/V1/SecretsEngines/Transit/TransitSecretsEngineProvider.cs
@@ -42,7 +42,7 @@ public async Task> GenerateDataKeyAsync(string keyType,
"v1/" + mountPoint.Trim('/') + "/datakey/" + keyType.Trim('/')+ "/" + keyName.Trim('/'), HttpMethod.Post, dataKeyRequestOptions, wrapTimeToLive: wrapTimeToLive).ConfigureAwait(_polymath.VaultClientSettings.ContinueAsyncTasksOnCapturedContext);
}
- public async Task CreateKeyAsync(string keyName, CreateKeyRequestOptions createKeyRequestOptions, string mountPoint = SecretsEngineDefaultPaths.Transit)
+ public async Task CreateEncryptionKeyAsync(string keyName, CreateKeyRequestOptions createKeyRequestOptions, string mountPoint = SecretsEngineDefaultPaths.Transit)
{
Checker.NotNull(keyName, "keyName");
Checker.NotNull(createKeyRequestOptions, "createKeyRequestOptions");
@@ -51,25 +51,22 @@ public async Task CreateKeyAsync(string keyName, CreateKeyRequestOptions createK
await _polymath.MakeVaultApiRequest