pub struct X509Svid { /* private fields */ }
Expand description
This type represents a SPIFFE X509-SVID.
Contains a SpiffeId
, a certificate chain as a vec of DER-encoded X.509 certificates,
and a private key as a DER-encoded ASN.1 in PKCS#8 format.
Implementations§
Source§impl X509Svid
impl X509Svid
Sourcepub fn parse_from_der(
cert_chain_der: &[u8],
private_key_der: &[u8],
) -> Result<Self, X509SvidError>
pub fn parse_from_der( cert_chain_der: &[u8], private_key_der: &[u8], ) -> Result<Self, X509SvidError>
Creates a X509Svid
from certificate chain and key ASN.1 DER-encoded data (binary format).
§Arguments
-
cert_chain_der
- Slice of bytes representing a chain of certificates as ASN.1 DER-encoded (concatenated with no intermediate padding if there are more than one certificate). -
private_key_der
- Slice of bytes representing a private key as ASN.1 DER in PKCS#8 format.
§Errors
If the function cannot parse the inputs, a X509SvidError
variant will be returned.
Sourcepub fn cert_chain(&self) -> &Vec<Certificate>
pub fn cert_chain(&self) -> &Vec<Certificate>
Returns the chain of Certificate
of the X509Svid
. The first certificate in the
chain is the leaf certificate.
Sourcepub fn leaf(&self) -> &Certificate
pub fn leaf(&self) -> &Certificate
Returns the leaf certificate of the chain.
Sourcepub fn private_key(&self) -> &PrivateKey
pub fn private_key(&self) -> &PrivateKey
Returns the private key of the X509Svid
.
Trait Implementations§
impl Eq for X509Svid
impl StructuralPartialEq for X509Svid
impl Svid for X509Svid
Auto Trait Implementations§
impl Freeze for X509Svid
impl RefUnwindSafe for X509Svid
impl Send for X509Svid
impl Sync for X509Svid
impl Unpin for X509Svid
impl UnwindSafe for X509Svid
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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
key
and return true
if they are equal.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