pub struct DnAttribute<'a> {
pub kind: DnAttributeKind,
pub printable_string: bool,
pub value: DnValue<'a>,
}Available on crate feature
rustcrypto only.Expand description
One attribute of a distinguished name.
Fields§
§kind: DnAttributeKindWhich attribute type this is.
printable_string: boolWhether the X.509 form encodes the value as a PrintableString rather than a
UTF8String. Only meaningful when
DnAttributeKind::has_printable_string_form; always false otherwise.
value: DnValue<'a>The value.
Implementations§
Source§impl<'a> DnAttribute<'a>
impl<'a> DnAttribute<'a>
Sourcepub const fn string(kind: DnAttributeKind, value: &'a str) -> Self
pub const fn string(kind: DnAttributeKind, value: &'a str) -> Self
A string attribute in its UTF8String form.
Sourcepub const fn printable(kind: DnAttributeKind, value: &'a str) -> Self
pub const fn printable(kind: DnAttributeKind, value: &'a str) -> Self
A string attribute in its PrintableString form — the +0x80 tag.
Sourcepub const fn uint(kind: DnAttributeKind, value: u64) -> Self
pub const fn uint(kind: DnAttributeKind, value: u64) -> Self
A Matter-specific scalar attribute.
Sourcepub const fn noc_cat(cat: CaseAuthenticatedTag) -> Self
pub const fn noc_cat(cat: CaseAuthenticatedTag) -> Self
matter-noc-cat.
Sourcepub const fn tag(&self) -> u8
pub const fn tag(&self) -> u8
The TLV context tag this attribute encodes under, +0x80 included.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Checks the attribute against the rules of §6.1.1 and §6.5.6.1.
A scalar whose type says four octets must fit in 32 bits, a string type must carry
a string, and the +0x80 form must only be used where Table 87 defines one.
Trait Implementations§
Source§impl<'a> Clone for DnAttribute<'a>
impl<'a> Clone for DnAttribute<'a>
impl<'a> Copy for DnAttribute<'a>
Source§impl<'a> Debug for DnAttribute<'a>
impl<'a> Debug for DnAttribute<'a>
impl<'a> Eq for DnAttribute<'a>
Source§impl<'a> PartialEq for DnAttribute<'a>
impl<'a> PartialEq for DnAttribute<'a>
impl<'a> StructuralPartialEq for DnAttribute<'a>
Auto Trait Implementations§
impl<'a> Forget for DnAttribute<'a>
impl<'a> Freeze for DnAttribute<'a>
impl<'a> Move for DnAttribute<'a>
impl<'a> RefUnwindSafe for DnAttribute<'a>
impl<'a> Send for DnAttribute<'a>
impl<'a> Sync for DnAttribute<'a>
impl<'a> Unpin for DnAttribute<'a>
impl<'a> UnsafeUnpin for DnAttribute<'a>
impl<'a> UnwindSafe for DnAttribute<'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