pub struct DistinguishedName<'a> { /* private fields */ }Available on crate feature
rustcrypto only.Expand description
A distinguished name: up to MAX_RDNS attributes, in order.
Implementations§
Source§impl<'a> DistinguishedName<'a>
impl<'a> DistinguishedName<'a>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
An empty name. A certificate with one is invalid — the schema says length 1.. —
but building one up starts here.
Sourcepub fn push(&mut self, attribute: DnAttribute<'a>) -> Result<()>
pub fn push(&mut self, attribute: DnAttribute<'a>) -> Result<()>
Appends an attribute.
Returns ErrorCode::CertInvalid past MAX_RDNS, because §6.5.6.3 makes that a
rejection rather than a truncation.
Sourcepub fn attributes(&self) -> &[DnAttribute<'a>]
pub fn attributes(&self) -> &[DnAttribute<'a>]
The attributes, in encoding order.
Sourcepub fn count(&self, kind: DnAttributeKind) -> usize
pub fn count(&self, kind: DnAttributeKind) -> usize
How many attributes of a kind there are.
Sourcepub fn single_uint(&self, kind: DnAttributeKind) -> Option<u64>
pub fn single_uint(&self, kind: DnAttributeKind) -> Option<u64>
The scalar of the single attribute of this kind, or None if there is not exactly
one.
“Not exactly one” rather than “the first”: a subject with two matter-fabric-id
attributes is invalid, and answering with either one would hide that.
Sourcepub fn fabric_id(&self) -> Option<FabricId>
pub fn fabric_id(&self) -> Option<FabricId>
The matter-fabric-id, if the DN carries exactly one.
Sourcepub fn noc_cats(&self) -> Vec<CaseAuthenticatedTag, MAX_NOC_CATS>
pub fn noc_cats(&self) -> Vec<CaseAuthenticatedTag, MAX_NOC_CATS>
Every matter-noc-cat in the DN, in order.
Trait Implementations§
Source§impl<'a> Clone for DistinguishedName<'a>
impl<'a> Clone for DistinguishedName<'a>
Source§impl<'a> Debug for DistinguishedName<'a>
impl<'a> Debug for DistinguishedName<'a>
Source§impl<'a> Default for DistinguishedName<'a>
impl<'a> Default for DistinguishedName<'a>
impl<'a> Eq for DistinguishedName<'a>
Source§impl<'a> PartialEq for DistinguishedName<'a>
impl<'a> PartialEq for DistinguishedName<'a>
impl<'a> StructuralPartialEq for DistinguishedName<'a>
Auto Trait Implementations§
impl<'a> Forget for DistinguishedName<'a>
impl<'a> Freeze for DistinguishedName<'a>
impl<'a> Move for DistinguishedName<'a>
impl<'a> RefUnwindSafe for DistinguishedName<'a>
impl<'a> Send for DistinguishedName<'a>
impl<'a> Sync for DistinguishedName<'a>
impl<'a> Unpin for DistinguishedName<'a>
impl<'a> UnsafeUnpin for DistinguishedName<'a>
impl<'a> UnwindSafe for DistinguishedName<'a>
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
Mutably borrows from an owned value. Read more