Certificate

Struct Certificate 

Source
#[non_exhaustive]
pub struct Certificate {
Show 13 fields pub name: String, pub issuer_certificate_authority: String, pub lifetime: Option<Duration>, pub certificate_template: String, pub subject_mode: SubjectRequestMode, pub revocation_details: Option<RevocationDetails>, pub pem_certificate: String, pub certificate_description: Option<CertificateDescription>, pub pem_certificate_chain: Vec<String>, pub create_time: Option<Timestamp>, pub update_time: Option<Timestamp>, pub labels: HashMap<String, String>, pub certificate_config: Option<CertificateConfig>, /* private fields */
}
Expand description

A Certificate corresponds to a signed X.509 certificate issued by a CertificateAuthority.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Identifier. The resource name for this Certificate in the format projects/*/locations/*/caPools/*/certificates/*.

§issuer_certificate_authority: String

Output only. The resource name of the issuing CertificateAuthority in the format projects/*/locations/*/caPools/*/certificateAuthorities/*.

§lifetime: Option<Duration>

Required. Immutable. The desired lifetime of a certificate. Used to create the “not_before_time” and “not_after_time” fields inside an X.509 certificate. Note that the lifetime may be truncated if it would extend past the life of any certificate authority in the issuing chain.

§certificate_template: String

Immutable. The resource name for a CertificateTemplate used to issue this certificate, in the format projects/*/locations/*/certificateTemplates/*. If this is specified, the caller must have the necessary permission to use this template. If this is omitted, no template will be used. This template must be in the same location as the Certificate.

§subject_mode: SubjectRequestMode

Immutable. Specifies how the Certificate’s identity fields are to be decided. If this is omitted, the DEFAULT subject mode will be used.

§revocation_details: Option<RevocationDetails>

Output only. Details regarding the revocation of this Certificate. This Certificate is considered revoked if and only if this field is present.

§pem_certificate: String

Output only. The pem-encoded, signed X.509 certificate.

§certificate_description: Option<CertificateDescription>

Output only. A structured description of the issued X.509 certificate.

§pem_certificate_chain: Vec<String>

Output only. The chain that may be used to verify the X.509 certificate. Expected to be in issuer-to-root order according to RFC 5246.

§create_time: Option<Timestamp>

Output only. The time at which this Certificate was created.

§update_time: Option<Timestamp>

Output only. The time at which this Certificate was updated.

§labels: HashMap<String, String>

Optional. Labels with user-defined metadata.

§certificate_config: Option<CertificateConfig>

The config used to create a signed X.509 certificate.

Implementations§

Source§

impl Certificate

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Certificate::new().set_name("example");
Source

pub fn set_issuer_certificate_authority<T: Into<String>>(self, v: T) -> Self

Sets the value of issuer_certificate_authority.

§Example
let x = Certificate::new().set_issuer_certificate_authority("example");
Source

pub fn set_lifetime<T>(self, v: T) -> Self
where T: Into<Duration>,

Sets the value of lifetime.

§Example
use wkt::Duration;
let x = Certificate::new().set_lifetime(Duration::default()/* use setters */);
Source

pub fn set_or_clear_lifetime<T>(self, v: Option<T>) -> Self
where T: Into<Duration>,

Sets or clears the value of lifetime.

§Example
use wkt::Duration;
let x = Certificate::new().set_or_clear_lifetime(Some(Duration::default()/* use setters */));
let x = Certificate::new().set_or_clear_lifetime(None::<Duration>);
Source

pub fn set_certificate_template<T: Into<String>>(self, v: T) -> Self

Sets the value of certificate_template.

§Example
let x = Certificate::new().set_certificate_template("example");
Source

pub fn set_subject_mode<T: Into<SubjectRequestMode>>(self, v: T) -> Self

Sets the value of subject_mode.

§Example
use google_cloud_security_privateca_v1::model::SubjectRequestMode;
let x0 = Certificate::new().set_subject_mode(SubjectRequestMode::Default);
let x1 = Certificate::new().set_subject_mode(SubjectRequestMode::RdnSequence);
let x2 = Certificate::new().set_subject_mode(SubjectRequestMode::ReflectedSpiffe);
Source

pub fn set_revocation_details<T>(self, v: T) -> Self

Sets the value of revocation_details.

§Example
use google_cloud_security_privateca_v1::model::certificate::RevocationDetails;
let x = Certificate::new().set_revocation_details(RevocationDetails::default()/* use setters */);
Source

pub fn set_or_clear_revocation_details<T>(self, v: Option<T>) -> Self

Sets or clears the value of revocation_details.

§Example
use google_cloud_security_privateca_v1::model::certificate::RevocationDetails;
let x = Certificate::new().set_or_clear_revocation_details(Some(RevocationDetails::default()/* use setters */));
let x = Certificate::new().set_or_clear_revocation_details(None::<RevocationDetails>);
Source

pub fn set_pem_certificate<T: Into<String>>(self, v: T) -> Self

Sets the value of pem_certificate.

§Example
let x = Certificate::new().set_pem_certificate("example");
Source

pub fn set_certificate_description<T>(self, v: T) -> Self

Sets the value of certificate_description.

§Example
use google_cloud_security_privateca_v1::model::CertificateDescription;
let x = Certificate::new().set_certificate_description(CertificateDescription::default()/* use setters */);
Source

pub fn set_or_clear_certificate_description<T>(self, v: Option<T>) -> Self

Sets or clears the value of certificate_description.

§Example
use google_cloud_security_privateca_v1::model::CertificateDescription;
let x = Certificate::new().set_or_clear_certificate_description(Some(CertificateDescription::default()/* use setters */));
let x = Certificate::new().set_or_clear_certificate_description(None::<CertificateDescription>);
Source

pub fn set_pem_certificate_chain<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of pem_certificate_chain.

§Example
let x = Certificate::new().set_pem_certificate_chain(["a", "b", "c"]);
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = Certificate::new().set_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of create_time.

§Example
use wkt::Timestamp;
let x = Certificate::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Certificate::new().set_or_clear_create_time(None::<Timestamp>);
Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

§Example
use wkt::Timestamp;
let x = Certificate::new().set_update_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of update_time.

§Example
use wkt::Timestamp;
let x = Certificate::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Certificate::new().set_or_clear_update_time(None::<Timestamp>);
Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

§Example
let x = Certificate::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_certificate_config<T: Into<Option<CertificateConfig>>>( self, v: T, ) -> Self

Sets the value of certificate_config.

Note that all the setters affecting certificate_config are mutually exclusive.

§Example
use google_cloud_security_privateca_v1::model::certificate::CertificateConfig;
let x = Certificate::new().set_certificate_config(Some(CertificateConfig::PemCsr("example".to_string())));
Source

pub fn pem_csr(&self) -> Option<&String>

The value of certificate_config if it holds a PemCsr, None if the field is not set or holds a different branch.

Source

pub fn set_pem_csr<T: Into<String>>(self, v: T) -> Self

Sets the value of certificate_config to hold a PemCsr.

Note that all the setters affecting certificate_config are mutually exclusive.

§Example
let x = Certificate::new().set_pem_csr("example");
assert!(x.pem_csr().is_some());
assert!(x.config().is_none());
Source

pub fn config(&self) -> Option<&Box<CertificateConfig>>

The value of certificate_config if it holds a Config, None if the field is not set or holds a different branch.

Source

pub fn set_config<T: Into<Box<CertificateConfig>>>(self, v: T) -> Self

Sets the value of certificate_config to hold a Config.

Note that all the setters affecting certificate_config are mutually exclusive.

§Example
use google_cloud_security_privateca_v1::model::CertificateConfig;
let x = Certificate::new().set_config(CertificateConfig::default()/* use setters */);
assert!(x.config().is_some());
assert!(x.pem_csr().is_none());

Trait Implementations§

Source§

impl Clone for Certificate

Source§

fn clone(&self) -> Certificate

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Certificate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Certificate

Source§

fn default() -> Certificate

Returns the “default value” for a type. Read more
Source§

impl Message for Certificate

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Certificate

Source§

fn eq(&self, other: &Certificate) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Certificate

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,