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§
source§impl 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§
source§impl AsRef<[u64]> for ObjectIdentifier
impl AsRef<[u64]> for ObjectIdentifier
source§impl BERDecodable for ObjectIdentifier
impl BERDecodable for ObjectIdentifier
source§fn decode_ber(reader: BERReader<'_, '_>) -> ASN1Result<Self>
fn decode_ber(reader: BERReader<'_, '_>) -> ASN1Result<Self>
source§impl Clone for ObjectIdentifier
impl Clone for ObjectIdentifier
source§fn clone(&self) -> ObjectIdentifier
fn clone(&self) -> ObjectIdentifier
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl DEREncodable for ObjectIdentifier
impl DEREncodable for ObjectIdentifier
source§fn encode_der(&self, writer: DERWriter<'_>)
fn encode_der(&self, writer: DERWriter<'_>)
Writes the value as an DER-encoded ASN.1 value. Read more
source§impl Debug for ObjectIdentifier
impl Debug for ObjectIdentifier
source§impl Display for ObjectIdentifier
impl Display for ObjectIdentifier
source§impl FromStr for ObjectIdentifier
impl FromStr for ObjectIdentifier
source§impl Hash for ObjectIdentifier
impl Hash for ObjectIdentifier
source§impl Ord for ObjectIdentifier
impl Ord for ObjectIdentifier
source§fn cmp(&self, other: &ObjectIdentifier) -> Ordering
fn cmp(&self, other: &ObjectIdentifier) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for ObjectIdentifier
impl PartialEq for ObjectIdentifier
source§fn eq(&self, other: &ObjectIdentifier) -> bool
fn eq(&self, other: &ObjectIdentifier) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ObjectIdentifier
impl PartialOrd for ObjectIdentifier
source§fn partial_cmp(&self, other: &ObjectIdentifier) -> Option<Ordering>
fn partial_cmp(&self, other: &ObjectIdentifier) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
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 StructuralPartialEq for ObjectIdentifier
Auto Trait Implementations§
impl Freeze for ObjectIdentifier
impl RefUnwindSafe for ObjectIdentifier
impl Send for ObjectIdentifier
impl Sync for ObjectIdentifier
impl Unpin for ObjectIdentifier
impl UnwindSafe for ObjectIdentifier
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