#[non_exhaustive]pub struct TlsaRecord {
pub usage: TlsaUsage,
pub selector: TlsaSelector,
pub matching_type: TlsaMatchingType,
pub certificate_data: Vec<u8>,
}Expand description
A parsed TLSA record.
Format: _port._tcp.hostname IN TLSA usage selector matching_type certificate_data
Example: _443._tcp.agent.example.com IN TLSA 3 0 1 <sha256-fingerprint>
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.usage: TlsaUsageCertificate usage (0-3)
selector: TlsaSelectorSelector (0=full cert, 1=SPKI)
matching_type: TlsaMatchingTypeMatching type (0=exact, 1=SHA-256, 2=SHA-512)
certificate_data: Vec<u8>Certificate association data (fingerprint or raw data)
Implementations§
Source§impl TlsaRecord
impl TlsaRecord
Sourcepub fn new(
usage: TlsaUsage,
selector: TlsaSelector,
matching_type: TlsaMatchingType,
certificate_data: Vec<u8>,
) -> Self
pub fn new( usage: TlsaUsage, selector: TlsaSelector, matching_type: TlsaMatchingType, certificate_data: Vec<u8>, ) -> Self
Create a new TLSA record from components.
Sourcepub fn from_rdata(rdata: &[u8]) -> Result<Self, DaneError>
pub fn from_rdata(rdata: &[u8]) -> Result<Self, DaneError>
Parse a TLSA record from raw RDATA bytes.
Sourcepub fn is_verifiable(&self) -> bool
pub fn is_verifiable(&self) -> bool
Check if this TLSA record is in a format we can verify.
Currently only supports DANE-EE (usage=3), full certificate (selector=0),
SHA-256 (matching_type=1) which is the ANS standard format.
Sourcepub fn matches_fingerprint(
&self,
cert_fingerprint: &CertFingerprint,
) -> Option<bool>
pub fn matches_fingerprint( &self, cert_fingerprint: &CertFingerprint, ) -> Option<bool>
Check if this TLSA record matches a certificate fingerprint.
Currently only supports DANE-EE (usage=3), full certificate (selector=0),
SHA-256 (matching_type=1) which is the ANS standard format.
Returns None if the record format is not supported (different from not matching).
Trait Implementations§
Source§impl Clone for TlsaRecord
impl Clone for TlsaRecord
Source§fn clone(&self) -> TlsaRecord
fn clone(&self) -> TlsaRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TlsaRecord
impl Debug for TlsaRecord
Source§impl PartialEq for TlsaRecord
impl PartialEq for TlsaRecord
impl Eq for TlsaRecord
impl StructuralPartialEq for TlsaRecord
Auto Trait Implementations§
impl Freeze for TlsaRecord
impl RefUnwindSafe for TlsaRecord
impl Send for TlsaRecord
impl Sync for TlsaRecord
impl Unpin for TlsaRecord
impl UnsafeUnpin for TlsaRecord
impl UnwindSafe for TlsaRecord
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.