pub struct GenerateDataKeyRequest {
pub mount: String,
pub key_type: DataKeyType,
pub name: String,
pub context: Option<String>,
pub nonce: Option<String>,
pub bits: Option<u16>,
}
Expand description
§Generate Data Key
This endpoint generates a new high-entropy key and the value encrypted with the named key. Optionally return the plaintext of the key as well. Whether plaintext is returned depends on the path; as a result, you can use Vault ACL policies to control whether a user is allowed to retrieve the plaintext value of a key. This is useful if you want an untrusted user or operation to generate keys that are then made available to trusted users.
- Path: {self.mount}/datakey/{self.key_type}/{self.name}
- Method: POST
- Response: GenerateDataKeyResponse
- Reference: https://developer.hashicorp.com/vault/api-docs/secret/transit#generate-data-key
Fields§
§mount: String
§key_type: DataKeyType
Specifies the type of key to generate. If plaintext, the plaintext key will be returned along with the ciphertext. If wrapped, only the ciphertext value will be returned.
name: String
Specifies the name of the encryption key to use to encrypt the datakey.
context: Option<String>
Specifies the key derivation context, provided as a base64-encoded string. This must be provided if derivation is enabled.
nonce: Option<String>
Specifies a nonce value, provided as base64 encoded. Must be provided if convergent encryption is enabled for this key and the key was generated with Vault 0.6.1. Not required for keys created in 0.6.2+. The value must be exactly 96 bits (12 bytes) long and the user must ensure that for any given context (and thus, any given encryption key) this nonce value is never reused.
bits: Option<u16>
Specifies the number of bits in the desired key. Can be 128, 256, or 512. Default is 256 bits.
Implementations§
source§impl GenerateDataKeyRequest
impl GenerateDataKeyRequest
pub fn builder() -> GenerateDataKeyRequestBuilder
Trait Implementations§
source§impl Debug for GenerateDataKeyRequest
impl Debug for GenerateDataKeyRequest
source§impl Default for GenerateDataKeyRequest
impl Default for GenerateDataKeyRequest
source§fn default() -> GenerateDataKeyRequest
fn default() -> GenerateDataKeyRequest
source§impl Endpoint for GenerateDataKeyRequest
impl Endpoint for GenerateDataKeyRequest
source§const REQUEST_BODY_TYPE: RequestType = RequestType::JSON
const REQUEST_BODY_TYPE: RequestType = RequestType::JSON
source§const RESPONSE_BODY_TYPE: ResponseType = ResponseType::JSON
const RESPONSE_BODY_TYPE: ResponseType = ResponseType::JSON
source§type Response = GenerateDataKeyResponse
type Response = GenerateDataKeyResponse
parse()
method is called.