pub type AttributeType = ObjectIdentifier;
Expand description
X.501 AttributeType
as defined in RFC 5280 Appendix A.1.
AttributeType ::= OBJECT IDENTIFIER
Aliased Type§
struct AttributeType { /* private fields */ }
Implementations
Source§impl ObjectIdentifier
impl ObjectIdentifier
Sourcepub const fn new_unwrap(s: &str) -> ObjectIdentifier
pub const fn new_unwrap(s: &str) -> ObjectIdentifier
Parse an ObjectIdentifier
from the dot-delimited string form,
panicking on parse errors.
This function exists as a workaround for unwrap
not yet being
stable in const fn
contexts, and is intended to allow the result to
be bound to a constant value:
use const_oid::ObjectIdentifier;
pub const MY_OID: ObjectIdentifier = ObjectIdentifier::new_unwrap("1.2.840.113549.1.1.1");
In future versions of Rust it should be possible to replace this with
ObjectIdentifier::new(...).unwrap()
.
Use ObjectIdentifier::new
for fallible parsing.
Sourcepub const fn new(s: &str) -> Result<ObjectIdentifier, Error>
pub const fn new(s: &str) -> Result<ObjectIdentifier, Error>
Parse an ObjectIdentifier
from the dot-delimited string form.
Sourcepub fn from_arcs(
arcs: impl IntoIterator<Item = u32>,
) -> Result<ObjectIdentifier, Error>
pub fn from_arcs( arcs: impl IntoIterator<Item = u32>, ) -> Result<ObjectIdentifier, Error>
Parse an OID from a slice of Arc
values (i.e. integers).
Sourcepub fn from_bytes(ber_bytes: &[u8]) -> Result<ObjectIdentifier, Error>
pub fn from_bytes(ber_bytes: &[u8]) -> Result<ObjectIdentifier, Error>
Parse an OID from from its BER/DER encoding.
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Get the BER/DER serialization of this OID as bytes.
Note that this encoding omits the tag/length, and only contains the value portion of the encoded OID.
Sourcepub fn arc(&self, index: usize) -> Option<u32>
pub fn arc(&self, index: usize) -> Option<u32>
Return the arc with the given index, if it exists.
Sourcepub fn arcs(&self) -> Arcs<'_>
pub fn arcs(&self) -> Arcs<'_>
Iterate over the arcs (a.k.a. nodes) of an ObjectIdentifier
.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the length of this ObjectIdentifier
in arcs.
Sourcepub fn parent(&self) -> Option<ObjectIdentifier>
pub fn parent(&self) -> Option<ObjectIdentifier>
Get the parent OID of this one (if applicable).
Trait Implementations
Source§impl AsRef<[u8]> for ObjectIdentifier
impl AsRef<[u8]> for ObjectIdentifier
Source§impl Clone for ObjectIdentifier
impl Clone for ObjectIdentifier
Source§fn clone(&self) -> ObjectIdentifier
fn clone(&self) -> ObjectIdentifier
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ObjectIdentifier
impl Debug for ObjectIdentifier
Source§impl<'a> DecodeValue<'a> for ObjectIdentifier
impl<'a> DecodeValue<'a> for ObjectIdentifier
Source§fn decode_value<R>(
reader: &mut R,
header: Header,
) -> Result<ObjectIdentifier, Error>where
R: Reader<'a>,
fn decode_value<R>(
reader: &mut R,
header: Header,
) -> Result<ObjectIdentifier, Error>where
R: Reader<'a>,
Reader
.