#[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 trusted_wrapping_enabled: bool,
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.
trusted_wrapping_enabled: boolOptional. Whether trusted wrapping will be enabled on the imported CryptoKeyVersion. This field is only supported for keys with CryptoKeyVersionTemplate.protection_level HSM_SINGLE_TENANT. This field is supported for all CryptoKeyPurposes besides ENCRYPT_DECRYPT.
wrapped_key_material: Option<WrappedKeyMaterial>This field is legacy. Use the field wrapped_key instead.
Implementations§
Source§impl ImportCryptoKeyVersionRequest
impl ImportCryptoKeyVersionRequest
Sourcepub fn set_parent<T: Into<String>>(self, v: T) -> Self
pub fn set_parent<T: Into<String>>(self, v: T) -> Self
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.
§Example
let x = ImportCryptoKeyVersionRequest::new().set_crypto_key_version(format!("projects/{project_id}/locations/{location_id}/keyRings/{key_ring_id}/cryptoKeys/{crypto_key_id}/cryptoKeyVersions/{crypto_key_version_id}"));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.
§Example
use google_cloud_kms_v1::model::crypto_key_version::CryptoKeyVersionAlgorithm;
let x0 = ImportCryptoKeyVersionRequest::new().set_algorithm(CryptoKeyVersionAlgorithm::GoogleSymmetricEncryption);
let x1 = ImportCryptoKeyVersionRequest::new().set_algorithm(CryptoKeyVersionAlgorithm::Aes128Gcm);
let x2 = ImportCryptoKeyVersionRequest::new().set_algorithm(CryptoKeyVersionAlgorithm::Aes256Gcm);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.
§Example
let x = ImportCryptoKeyVersionRequest::new().set_import_job("example");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.
§Example
let x = ImportCryptoKeyVersionRequest::new().set_wrapped_key(bytes::Bytes::from_static(b"example"));Sourcepub fn set_trusted_wrapping_enabled<T: Into<bool>>(self, v: T) -> Self
pub fn set_trusted_wrapping_enabled<T: Into<bool>>(self, v: T) -> Self
Sets the value of trusted_wrapping_enabled.
§Example
let x = ImportCryptoKeyVersionRequest::new().set_trusted_wrapping_enabled(true);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.
§Example
use google_cloud_kms_v1::model::import_crypto_key_version_request::WrappedKeyMaterial;
let x = ImportCryptoKeyVersionRequest::new().set_wrapped_key_material(Some(WrappedKeyMaterial::RsaAesWrappedKey(bytes::Bytes::from_static(b"example"))));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.
§Example
let x = ImportCryptoKeyVersionRequest::new().set_rsa_aes_wrapped_key(bytes::Bytes::from_static(b"example"));
assert!(x.rsa_aes_wrapped_key().is_some());Trait Implementations§
Source§impl Clone for ImportCryptoKeyVersionRequest
impl Clone for ImportCryptoKeyVersionRequest
Source§fn clone(&self) -> ImportCryptoKeyVersionRequest
fn clone(&self) -> ImportCryptoKeyVersionRequest
1.0.0 (const: unstable) · 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
impl StructuralPartialEq for ImportCryptoKeyVersionRequest
Auto Trait Implementations§
impl !Freeze for ImportCryptoKeyVersionRequest
impl RefUnwindSafe for ImportCryptoKeyVersionRequest
impl Send for ImportCryptoKeyVersionRequest
impl Sync for ImportCryptoKeyVersionRequest
impl Unpin for ImportCryptoKeyVersionRequest
impl UnsafeUnpin for ImportCryptoKeyVersionRequest
impl UnwindSafe for ImportCryptoKeyVersionRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request