#[non_exhaustive]pub struct ImportCryptoKeyVersionRequest {
pub parent: String,
pub crypto_key_version: String,
pub algorithm: CryptoKeyVersionAlgorithm,
pub import_job: String,
pub wrapped_key: Bytes,
pub wrapped_key_material: Option<WrappedKeyMaterial>,
/* private fields */
}Expand description
Request message for KeyManagementService.ImportCryptoKeyVersion.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parent: StringRequired. The name of the CryptoKey to be imported into.
The create permission is only required on this key when creating a new CryptoKeyVersion.
crypto_key_version: StringOptional. The optional name of an existing CryptoKeyVersion to target for an import operation. If this field is not present, a new CryptoKeyVersion containing the supplied key material is created.
If this field is present, the supplied key material is imported into the existing CryptoKeyVersion. To import into an existing CryptoKeyVersion, the CryptoKeyVersion must be a child of ImportCryptoKeyVersionRequest.parent, have been previously created via ImportCryptoKeyVersion, and be in DESTROYED or IMPORT_FAILED state. The key material and algorithm must match the previous CryptoKeyVersion exactly if the CryptoKeyVersion has ever contained key material.
algorithm: CryptoKeyVersionAlgorithmRequired. The algorithm of the key being imported. This does not need to match the version_template of the CryptoKey this version imports into.
import_job: String§wrapped_key: BytesOptional. The wrapped key material to import.
Before wrapping, key material must be formatted. If importing symmetric key material, the expected key material format is plain bytes. If importing asymmetric key material, the expected key material format is PKCS#8-encoded DER (the PrivateKeyInfo structure from RFC 5208).
When wrapping with import methods (RSA_OAEP_3072_SHA1_AES_256 or RSA_OAEP_4096_SHA1_AES_256 or RSA_OAEP_3072_SHA256_AES_256 or RSA_OAEP_4096_SHA256_AES_256),
this field must contain the concatenation of:
This format is the same as the format produced by PKCS#11 mechanism CKM_RSA_AES_KEY_WRAP.
When wrapping with import methods (RSA_OAEP_3072_SHA256 or RSA_OAEP_4096_SHA256),
this field must contain the formatted key to be imported, wrapped with the public_key using RSAES-OAEP with SHA-256, MGF1 with SHA-256, and an empty label.
wrapped_key_material: Option<WrappedKeyMaterial>This field is legacy. Use the field wrapped_key instead.
Implementations§
Source§impl ImportCryptoKeyVersionRequest
impl ImportCryptoKeyVersionRequest
pub fn new() -> Self
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> Self
Sets the value of parent.
Sourcepub fn set_crypto_key_version<T: Into<String>>(self, v: T) -> Self
pub fn set_crypto_key_version<T: Into<String>>(self, v: T) -> Self
Sets the value of crypto_key_version.
Sourcepub fn set_algorithm<T: Into<CryptoKeyVersionAlgorithm>>(self, v: T) -> Self
pub fn set_algorithm<T: Into<CryptoKeyVersionAlgorithm>>(self, v: T) -> Self
Sets the value of algorithm.
Sourcepub fn set_import_job<T: Into<String>>(self, v: T) -> Self
pub fn set_import_job<T: Into<String>>(self, v: T) -> Self
Sets the value of import_job.
Sourcepub fn set_wrapped_key<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_wrapped_key<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of wrapped_key.
Sourcepub fn set_wrapped_key_material<T: Into<Option<WrappedKeyMaterial>>>(
self,
v: T,
) -> Self
pub fn set_wrapped_key_material<T: Into<Option<WrappedKeyMaterial>>>( self, v: T, ) -> Self
Sets the value of wrapped_key_material.
Note that all the setters affecting wrapped_key_material are mutually
exclusive.
Sourcepub fn rsa_aes_wrapped_key(&self) -> Option<&Bytes>
pub fn rsa_aes_wrapped_key(&self) -> Option<&Bytes>
The value of wrapped_key_material
if it holds a RsaAesWrappedKey, None if the field is not set or
holds a different branch.
Sourcepub fn set_rsa_aes_wrapped_key<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_rsa_aes_wrapped_key<T: Into<Bytes>>(self, v: T) -> Self
Sets the value of wrapped_key_material
to hold a RsaAesWrappedKey.
Note that all the setters affecting wrapped_key_material are
mutually exclusive.
Trait Implementations§
Source§impl Clone for ImportCryptoKeyVersionRequest
impl Clone for ImportCryptoKeyVersionRequest
Source§fn clone(&self) -> ImportCryptoKeyVersionRequest
fn clone(&self) -> ImportCryptoKeyVersionRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for ImportCryptoKeyVersionRequest
impl Default for ImportCryptoKeyVersionRequest
Source§fn default() -> ImportCryptoKeyVersionRequest
fn default() -> ImportCryptoKeyVersionRequest
Source§impl PartialEq for ImportCryptoKeyVersionRequest
impl PartialEq for ImportCryptoKeyVersionRequest
Source§fn eq(&self, other: &ImportCryptoKeyVersionRequest) -> bool
fn eq(&self, other: &ImportCryptoKeyVersionRequest) -> bool
self and other values to be equal, and is used by ==.