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.0 · sourceconst 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
sourceimpl Hash for ObjectIdentifier
impl Hash for ObjectIdentifier
sourceimpl Ord for ObjectIdentifier
impl Ord for ObjectIdentifier
sourcefn cmp(&self, other: &ObjectIdentifier) -> Ordering
fn cmp(&self, other: &ObjectIdentifier) -> Ordering
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
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.0 · sourceconst 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 moreimpl 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more