[−][src]Struct yasna::models::TaggedDerValue
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.
Methods
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]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
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]
fn lt(&self, other: &TaggedDerValue) -> bool
[src]
fn le(&self, other: &TaggedDerValue) -> bool
[src]
fn gt(&self, other: &TaggedDerValue) -> bool
[src]
fn ge(&self, other: &TaggedDerValue) -> bool
[src]
impl Ord for TaggedDerValue
[src]
fn cmp(&self, other: &TaggedDerValue) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more
impl Eq for TaggedDerValue
[src]
impl Hash for TaggedDerValue
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Debug for TaggedDerValue
[src]
Auto Trait Implementations
impl Send for TaggedDerValue
impl Sync for TaggedDerValue
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,