pub struct CryptoKey {
pub name: String,
pub primary: Option<CryptoKeyVersion>,
pub purpose: i32,
pub create_time: Option<Timestamp>,
pub next_rotation_time: Option<Timestamp>,
pub version_template: Option<CryptoKeyVersionTemplate>,
pub labels: BTreeMap<String, String>,
pub import_only: bool,
pub destroy_scheduled_duration: Option<Duration>,
pub crypto_key_backend: String,
pub key_access_justifications_policy: Option<KeyAccessJustificationsPolicy>,
pub rotation_schedule: Option<RotationSchedule>,
}
Expand description
A [CryptoKey][google.cloud.kms.v1.CryptoKey] represents a logical key that can be used for cryptographic operations.
A [CryptoKey][google.cloud.kms.v1.CryptoKey] is made up of zero or more [versions][google.cloud.kms.v1.CryptoKeyVersion], which represent the actual key material used in cryptographic operations.
Fields§
§name: String
Output only. The resource name for this
[CryptoKey][google.cloud.kms.v1.CryptoKey] in the format
projects/*/locations/*/keyRings/*/cryptoKeys/*
.
primary: Option<CryptoKeyVersion>
Output only. A copy of the “primary” [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name].
The [CryptoKey][google.cloud.kms.v1.CryptoKey]’s primary version can be updated via [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion].
Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] may have a primary. For other keys, this field will be omitted.
purpose: i32
Immutable. The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
create_time: Option<Timestamp>
Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created.
next_rotation_time: Option<Timestamp>
At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically:
- Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey].
- Mark the new version as primary.
Key rotations performed manually via [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time].
Keys with [purpose][google.cloud.kms.v1.CryptoKey.purpose] [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT] support automatic rotation. For other keys, this field must be omitted.
version_template: Option<CryptoKeyVersionTemplate>
A template describing settings for new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances. The properties of new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] instances created by either [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] or auto-rotation are controlled by this template.
labels: BTreeMap<String, String>
Labels with user-defined metadata. For more information, see Labeling Keys.
import_only: bool
Immutable. Whether this key may contain imported versions only.
destroy_scheduled_duration: Option<Duration>
Immutable. The period of time that versions of this key spend in the [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] state before transitioning to [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. If not specified at creation time, the default duration is 24 hours.
crypto_key_backend: String
Immutable. The resource name of the backend environment where the key
material for all [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]
associated with this [CryptoKey][google.cloud.kms.v1.CryptoKey] reside and
where all related cryptographic operations are performed. Only applicable
if [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] have a
[ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of
[EXTERNAL_VPC][CryptoKeyVersion.ProtectionLevel.EXTERNAL_VPC], with the
resource name in the format projects/*/locations/*/ekmConnections/*
.
Note, this list is non-exhaustive and may apply to additional
[ProtectionLevels][google.cloud.kms.v1.ProtectionLevel] in the future.
key_access_justifications_policy: Option<KeyAccessJustificationsPolicy>
Optional. The policy used for Key Access Justifications Policy Enforcement. If this field is present and this key is enrolled in Key Access Justifications Policy Enforcement, the policy will be evaluated in encrypt, decrypt, and sign operations, and the operation will fail if rejected by the policy. The policy is defined by specifying zero or more allowed justification codes. https://cloud.google.com/assured-workloads/key-access-justifications/docs/justification-codes By default, this field is absent, and all justification codes are allowed.
rotation_schedule: Option<RotationSchedule>
Controls the rate of automatic rotation.
Implementations§
source§impl CryptoKey
impl CryptoKey
sourcepub fn purpose(&self) -> CryptoKeyPurpose
pub fn purpose(&self) -> CryptoKeyPurpose
Returns the enum value of purpose
, or the default if the field is set to an invalid enum value.
sourcepub fn set_purpose(&mut self, value: CryptoKeyPurpose)
pub fn set_purpose(&mut self, value: CryptoKeyPurpose)
Sets purpose
to the provided enum value.
Trait Implementations§
source§impl Message for CryptoKey
impl Message for CryptoKey
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 CryptoKey
impl PartialEq for CryptoKey
impl StructuralPartialEq for CryptoKey
Auto Trait Implementations§
impl !Freeze for CryptoKey
impl RefUnwindSafe for CryptoKey
impl Send for CryptoKey
impl Sync for CryptoKey
impl Unpin for CryptoKey
impl UnwindSafe for CryptoKey
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