pub struct TlsCertMetadata {
pub service_id: u64,
pub cert_id: String,
pub certificate_pem: String,
pub serial: String,
pub expires_at: u64,
pub is_revoked: bool,
pub usage: String,
pub common_name: String,
pub subject_alt_names: Vec<String>,
pub issued_at: u64,
pub issued_by_api_key_id: u64,
pub tenant_id: Option<String>,
}Expand description
TLS certificate metadata for issued certificates
Fields§
§service_id: u64The service ID this certificate belongs to
cert_id: StringThe certificate ID (unique within service)
certificate_pem: StringCertificate PEM encoded
serial: StringCertificate serial number
expires_at: u64Certificate expiration timestamp (seconds since epoch)
is_revoked: boolWhether the certificate is revoked
usage: StringCertificate usage (client, server, both)
common_name: StringSubject common name
subject_alt_names: Vec<String>Subject alternative names
issued_at: u64Issuance timestamp (seconds since epoch)
issued_by_api_key_id: u64Issuing API key ID (for auditing)
tenant_id: Option<String>Tenant ID associated with this certificate
Implementations§
Source§impl TlsCertMetadata
impl TlsCertMetadata
Sourcepub fn new(config: TlsCertMetadataConfig) -> Self
pub fn new(config: TlsCertMetadataConfig) -> Self
Create a new certificate metadata entry
Sourcepub fn save(&self, db: &RocksDb) -> Result<(), Error>
pub fn save(&self, db: &RocksDb) -> Result<(), Error>
Save the certificate metadata to the database
Sourcepub fn find_by_service_and_cert_id(
service_id: u64,
cert_id: &str,
db: &RocksDb,
) -> Result<Option<Self>, Error>
pub fn find_by_service_and_cert_id( service_id: u64, cert_id: &str, db: &RocksDb, ) -> Result<Option<Self>, Error>
Find certificate metadata by service ID and certificate ID
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the certificate is expired
Sourcepub fn add_subject_alt_name(&mut self, san: String)
pub fn add_subject_alt_name(&mut self, san: String)
Add a subject alternative name
Sourcepub fn set_tenant_id(&mut self, tenant_id: String)
pub fn set_tenant_id(&mut self, tenant_id: String)
Set the tenant ID
Trait Implementations§
Source§impl Clone for TlsCertMetadata
impl Clone for TlsCertMetadata
Source§fn clone(&self) -> TlsCertMetadata
fn clone(&self) -> TlsCertMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TlsCertMetadata
impl Debug for TlsCertMetadata
Source§impl Default for TlsCertMetadata
impl Default for TlsCertMetadata
Source§impl Message for TlsCertMetadata
impl Message for TlsCertMetadata
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
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,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
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,
Encodes the message with a length-delimiter to a buffer. Read more
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,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Decodes an instance of the message from a buffer. Read more
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,
Decodes a length-delimited instance of the message from the buffer.
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,
Decodes an instance of the message from a buffer, and merges it into
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,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for TlsCertMetadata
impl PartialEq for TlsCertMetadata
impl Eq for TlsCertMetadata
impl StructuralPartialEq for TlsCertMetadata
Auto Trait Implementations§
impl Freeze for TlsCertMetadata
impl RefUnwindSafe for TlsCertMetadata
impl Send for TlsCertMetadata
impl Sync for TlsCertMetadata
impl Unpin for TlsCertMetadata
impl UnwindSafe for TlsCertMetadata
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.