Struct yasna::models::TaggedDerValue [−][src]
Container for a tag and arbitrary DER value.
When obtained by BERReader::read_tagged_der
in DER mode,
the reader verifies that the payload is actually valid DER.
When constructed from bytes, the caller is responsible for
providing valid DER.
Implementations
impl TaggedDerValue
[src]
pub fn from_octetstring(bytes: Vec<u8>) -> Self
[src]
Constructs a new TaggedDerValue
as an octet string
pub fn from_tag_and_bytes(tag: Tag, bytes: Vec<u8>) -> Self
[src]
Constructs a new TaggedDerValue
from its tag and content
pub fn from_tag_pc_and_bytes(tag: Tag, pcbit: PCBit, bytes: Vec<u8>) -> Self
[src]
Constructs a new TaggedDerValue
from its tag,
primitive/constructed bit, and content
pub fn tag(&self) -> Tag
[src]
Returns the tag
pub fn pcbit(&self) -> PCBit
[src]
Returns the primitive/constructed bit
pub fn value(&self) -> &[u8]
[src]
Returns the value
pub fn as_bytes(&self) -> Option<&[u8]>
[src]
If the value is something that contains raw bytes, returns its content.
Examples
use yasna::models::TaggedDerValue; let value = TaggedDerValue::from_octetstring(vec![1, 2, 3, 4, 5, 6]); assert!(value.as_bytes() == Some(&[1, 2, 3, 4, 5, 6]));
pub fn as_str(&self) -> Option<&str>
[src]
If the value is something string-like, returns it as string.
Trait Implementations
impl BERDecodable for TaggedDerValue
[src]
fn decode_ber(reader: BERReader<'_, '_>) -> ASN1Result<Self>
[src]
impl Clone for TaggedDerValue
[src]
fn clone(&self) -> TaggedDerValue
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TaggedDerValue
[src]
impl Eq for TaggedDerValue
[src]
impl Hash for TaggedDerValue
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for TaggedDerValue
[src]
fn cmp(&self, other: &TaggedDerValue) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<TaggedDerValue> for TaggedDerValue
[src]
fn eq(&self, other: &TaggedDerValue) -> bool
[src]
fn ne(&self, other: &TaggedDerValue) -> bool
[src]
impl PartialOrd<TaggedDerValue> for TaggedDerValue
[src]
fn partial_cmp(&self, other: &TaggedDerValue) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for TaggedDerValue
[src]
impl StructuralPartialEq for TaggedDerValue
[src]
Auto Trait Implementations
impl RefUnwindSafe for TaggedDerValue
impl Send for TaggedDerValue
impl Sync for TaggedDerValue
impl Unpin for TaggedDerValue
impl UnwindSafe for TaggedDerValue
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,