Struct c509_certificate::oid::C509oid
source · pub struct C509oid {
oid: Oid<'static>,
pen_supported: bool,
}
Expand description
A struct represent an instance of C509oid
.
Fields§
§oid: Oid<'static>
The OID.
pen_supported: bool
The flag to indicate whether PEN encoding is supported.
Implementations§
Trait Implementations§
source§impl Decode<'_, ()> for C509oid
impl Decode<'_, ()> for C509oid
source§fn decode(d: &mut Decoder<'_>, _ctx: &mut ()) -> Result<Self, Error>
fn decode(d: &mut Decoder<'_>, _ctx: &mut ()) -> Result<Self, Error>
Decode an OID
If the data to be decoded is a Tag
, and the tag is an OID_PEN_TAG
,
then decode the OID as Private Enterprise Number (PEN) OID.
else decode the OID as unwrapped OID (~oid) - as bytes string without tag.
§Returns
A C509oid instance. If the decoding fails, it will return an error.
source§impl<'de> Deserialize<'de> for C509oid
impl<'de> Deserialize<'de> for C509oid
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Encode<()> for C509oid
impl Encode<()> for C509oid
source§fn encode<W: Write>(
&self,
e: &mut Encoder<W>,
_ctx: &mut (),
) -> Result<(), Error<W::Error>>
fn encode<W: Write>( &self, e: &mut Encoder<W>, _ctx: &mut (), ) -> Result<(), Error<W::Error>>
Encode an OID
If pen_supported
flag is set, and OID start with a valid PEN_PREFIX
,
it is encoded as PEN (Private Enterprise Number)
else encode as an unwrapped OID (~oid) - as bytes string without tag.
§Returns
A vector of bytes containing the CBOR encoded OID. If the encoding fails, it will return an error.
impl Eq for C509oid
impl StructuralPartialEq for C509oid
Auto Trait Implementations§
impl Freeze for C509oid
impl RefUnwindSafe for C509oid
impl Send for C509oid
impl Sync for C509oid
impl Unpin for C509oid
impl UnwindSafe for C509oid
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)