pub struct ImportJob {
pub name: String,
pub import_method: i32,
pub protection_level: i32,
pub create_time: Option<Timestamp>,
pub generate_time: Option<Timestamp>,
pub expire_time: Option<Timestamp>,
pub expire_event_time: Option<Timestamp>,
pub state: i32,
pub public_key: Option<WrappingPublicKey>,
pub attestation: Option<KeyOperationAttestation>,
}
Expand description
An [ImportJob][google.cloud.kms.v1.ImportJob] can be used to create [CryptoKeys][google.cloud.kms.v1.CryptoKey] and [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] using pre-existing key material, generated outside of Cloud KMS.
When an [ImportJob][google.cloud.kms.v1.ImportJob] is created, Cloud KMS will generate a “wrapping key”, which is a public/private key pair. You use the wrapping key to encrypt (also known as wrap) the pre-existing key material to protect it during the import process. The nature of the wrapping key depends on the choice of [import_method][google.cloud.kms.v1.ImportJob.import_method]. When the wrapping key generation is complete, the [state][google.cloud.kms.v1.ImportJob.state] will be set to [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE] and the [public_key][google.cloud.kms.v1.ImportJob.public_key] can be fetched. The fetched public key can then be used to wrap your pre-existing key material.
Once the key material is wrapped, it can be imported into a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in an existing [CryptoKey][google.cloud.kms.v1.CryptoKey] by calling [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion]. Multiple [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] can be imported with a single [ImportJob][google.cloud.kms.v1.ImportJob]. Cloud KMS uses the private key portion of the wrapping key to unwrap the key material. Only Cloud KMS has access to the private key.
An [ImportJob][google.cloud.kms.v1.ImportJob] expires 3 days after it is created. Once expired, Cloud KMS will no longer be able to import or unwrap any key material that was wrapped with the [ImportJob][google.cloud.kms.v1.ImportJob]’s public key.
For more information, see Importing a key.
Fields§
§name: String
Output only. The resource name for this
[ImportJob][google.cloud.kms.v1.ImportJob] in the format
projects/*/locations/*/keyRings/*/importJobs/*
.
import_method: i32
Required. Immutable. The wrapping method to be used for incoming key material.
protection_level: i32
Required. Immutable. The protection level of the [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level] of the [version_template][google.cloud.kms.v1.CryptoKey.version_template] on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import into.
create_time: Option<Timestamp>
Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] was created.
generate_time: Option<Timestamp>
Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]’s key material was generated.
expire_time: Option<Timestamp>
Output only. The time at which this [ImportJob][google.cloud.kms.v1.ImportJob] is scheduled for expiration and can no longer be used to import key material.
expire_event_time: Option<Timestamp>
Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob] expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED].
state: i32
Output only. The current state of the [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used.
public_key: Option<WrappingPublicKey>
Output only. The public key with which to wrap key material prior to import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE].
attestation: Option<KeyOperationAttestation>
Output only. Statement that was generated and signed by the key creator (for example, an HSM) at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only present if the chosen [ImportMethod][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
Implementations§
source§impl ImportJob
impl ImportJob
sourcepub fn import_method(&self) -> ImportMethod
pub fn import_method(&self) -> ImportMethod
Returns the enum value of import_method
, or the default if the field is set to an invalid enum value.
sourcepub fn set_import_method(&mut self, value: ImportMethod)
pub fn set_import_method(&mut self, value: ImportMethod)
Sets import_method
to the provided enum value.
sourcepub fn state(&self) -> ImportJobState
pub fn state(&self) -> ImportJobState
Returns the enum value of state
, or the default if the field is set to an invalid enum value.
sourcepub fn set_state(&mut self, value: ImportJobState)
pub fn set_state(&mut self, value: ImportJobState)
Sets state
to the provided enum value.
sourcepub fn protection_level(&self) -> ProtectionLevel
pub fn protection_level(&self) -> ProtectionLevel
Returns the enum value of protection_level
, or the default if the field is set to an invalid enum value.
sourcepub fn set_protection_level(&mut self, value: ProtectionLevel)
pub fn set_protection_level(&mut self, value: ProtectionLevel)
Sets protection_level
to the provided enum value.
Trait Implementations§
source§impl Message for ImportJob
impl Message for ImportJob
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for ImportJob
impl PartialEq for ImportJob
impl StructuralPartialEq for ImportJob
Auto Trait Implementations§
impl !Freeze for ImportJob
impl RefUnwindSafe for ImportJob
impl Send for ImportJob
impl Sync for ImportJob
impl Unpin for ImportJob
impl UnwindSafe for ImportJob
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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