Struct yasna::models::ObjectIdentifier
source · [−]pub struct ObjectIdentifier { /* private fields */ }
Expand description
A type that represents object identifiers.
This is actually a thin wrapper of Vec<u64>
.
Examples
use yasna::models::ObjectIdentifier;
let sha384WithRSAEncryption = ObjectIdentifier::from_slice(&
[1, 2, 840, 113549, 1, 1, 12]);
println!("{}", sha384WithRSAEncryption);
Implementations
sourceimpl ObjectIdentifier
impl ObjectIdentifier
sourcepub fn new(components: Vec<u64>) -> Self
pub fn new(components: Vec<u64>) -> Self
Constructs a new ObjectIdentifier
from Vec<u64>
.
Examples
use yasna::models::ObjectIdentifier;
let pkcs1 = ObjectIdentifier::new(
[1, 2, 840, 113549, 1, 1].to_vec());
println!("{}", pkcs1);
sourcepub fn from_slice(components: &[u64]) -> Self
pub fn from_slice(components: &[u64]) -> Self
Constructs a new ObjectIdentifier
from &[u64]
.
Examples
use yasna::models::ObjectIdentifier;
let pkcs1 = ObjectIdentifier::from_slice(&
[1, 2, 840, 113549, 1, 1]);
println!("{}", pkcs1);
sourcepub fn components(&self) -> &Vec<u64>
pub fn components(&self) -> &Vec<u64>
Borrows its internal vector of components.
Examples
use yasna::models::ObjectIdentifier;
let pkcs1 = ObjectIdentifier::from_slice(&
[1, 2, 840, 113549, 1, 1]);
let components : &Vec<u64> = pkcs1.components();
sourcepub fn components_mut(&mut self) -> &mut Vec<u64>
pub fn components_mut(&mut self) -> &mut Vec<u64>
Mutably borrows its internal vector of components.
Examples
use yasna::models::ObjectIdentifier;
let mut pkcs1 = ObjectIdentifier::from_slice(&
[1, 2, 840, 113549, 1, 1]);
let components : &mut Vec<u64> = pkcs1.components_mut();
sourcepub fn into_components(self) -> Vec<u64>
pub fn into_components(self) -> Vec<u64>
Extracts its internal vector of components.
Examples
use yasna::models::ObjectIdentifier;
let pkcs1 = ObjectIdentifier::from_slice(&
[1, 2, 840, 113549, 1, 1]);
let mut components : Vec<u64> = pkcs1.into_components();
Trait Implementations
sourceimpl AsRef<[u64]> for ObjectIdentifier
impl AsRef<[u64]> for ObjectIdentifier
sourceimpl BERDecodable for ObjectIdentifier
impl BERDecodable for ObjectIdentifier
sourcefn decode_ber(reader: BERReader<'_, '_>) -> ASN1Result<Self>
fn decode_ber(reader: BERReader<'_, '_>) -> ASN1Result<Self>
sourceimpl Clone for ObjectIdentifier
impl Clone for ObjectIdentifier
sourcefn clone(&self) -> ObjectIdentifier
fn clone(&self) -> ObjectIdentifier
Returns a copy of the value. Read more
1.0.0const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl DEREncodable for ObjectIdentifier
impl DEREncodable for ObjectIdentifier
sourcefn encode_der(&self, writer: DERWriter<'_>)
fn encode_der(&self, writer: DERWriter<'_>)
Writes the value as an DER-encoded ASN.1 value. Read more
sourceimpl Debug for ObjectIdentifier
impl Debug for ObjectIdentifier
sourceimpl Display for ObjectIdentifier
impl Display for ObjectIdentifier
sourceimpl From<Vec<u64, Global>> for ObjectIdentifier
impl From<Vec<u64, Global>> for ObjectIdentifier
sourcefn from(components: Vec<u64>) -> ObjectIdentifier
fn from(components: Vec<u64>) -> ObjectIdentifier
Converts to this type from the input type.
sourceimpl FromStr for ObjectIdentifier
impl FromStr for ObjectIdentifier
type Err = ParseOidError
type Err = ParseOidError
The associated error which can be returned from parsing.
sourceimpl Hash for ObjectIdentifier
impl Hash for ObjectIdentifier
sourcefn hash<__H: Hasher>(&self, state: &mut __H)
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [
Hasher
]. Read more1.3.0fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
Feeds a slice of this type into the given [
Hasher
]. Read moresourceimpl Ord for ObjectIdentifier
impl Ord for ObjectIdentifier
sourceimpl PartialEq<ObjectIdentifier> for ObjectIdentifier
impl PartialEq<ObjectIdentifier> for ObjectIdentifier
sourcefn eq(&self, other: &ObjectIdentifier) -> bool
fn eq(&self, other: &ObjectIdentifier) -> bool
sourceimpl PartialOrd<ObjectIdentifier> for ObjectIdentifier
impl PartialOrd<ObjectIdentifier> for ObjectIdentifier
sourcefn partial_cmp(&self, other: &ObjectIdentifier) -> Option<Ordering>
fn partial_cmp(&self, other: &ObjectIdentifier) -> Option<Ordering>
1.0.0const fn lt(&self, other: &Rhs) -> bool
const fn lt(&self, other: &Rhs) -> bool
1.0.0const fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more1.0.0const fn gt(&self, other: &Rhs) -> bool
const fn gt(&self, other: &Rhs) -> bool
impl Eq for ObjectIdentifier
impl StructuralEq for ObjectIdentifier
impl StructuralPartialEq for ObjectIdentifier
Auto Trait Implementations
impl RefUnwindSafe for ObjectIdentifier
impl Send for ObjectIdentifier
impl Sync for ObjectIdentifier
impl Unpin for ObjectIdentifier
impl UnwindSafe for ObjectIdentifier
Blanket Implementations
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
Uses borrowed data to replace owned data, usually by cloning. Read more