Struct rpki::crypto::keys::KeyIdentifier
source · pub struct KeyIdentifier(/* private fields */);
Expand description
A key identifier.
This is the SHA-1 hash over the public key’s bits.
Implementations§
source§impl KeyIdentifier
impl KeyIdentifier
source§impl KeyIdentifier
impl KeyIdentifier
sourcepub fn take_from<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Self, DecodeError<S::Error>>
pub fn take_from<S: Source>( cons: &mut Constructed<'_, S> ) -> Result<Self, DecodeError<S::Error>>
Takes an encoded key identifier from a constructed value.
KeyIdentifier ::= OCTET STRING
The content of the octet string needs to be a SHA-1 hash, so it must be exactly 20 octets long.
pub fn take_opt_from<S: Source>( cons: &mut Constructed<'_, S> ) -> Result<Option<Self>, DecodeError<S::Error>>
sourcepub fn from_content<S: Source>(
content: &mut Content<'_, S>
) -> Result<Self, DecodeError<S::Error>>
pub fn from_content<S: Source>( content: &mut Content<'_, S> ) -> Result<Self, DecodeError<S::Error>>
Parses an encoded key identifer from encoded content.
sourcepub fn skip_opt_in<S: Source>(
cons: &mut Constructed<'_, S>
) -> Result<Option<()>, DecodeError<S::Error>>
pub fn skip_opt_in<S: Source>( cons: &mut Constructed<'_, S> ) -> Result<Option<()>, DecodeError<S::Error>>
Skips over an encoded key indentifier.
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for KeyIdentifier
impl<'arbitrary> Arbitrary<'arbitrary> for KeyIdentifier
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read moresource§impl AsRef<[u8]> for KeyIdentifier
impl AsRef<[u8]> for KeyIdentifier
source§impl Clone for KeyIdentifier
impl Clone for KeyIdentifier
source§fn clone(&self) -> KeyIdentifier
fn clone(&self) -> KeyIdentifier
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 Debug for KeyIdentifier
impl Debug for KeyIdentifier
source§impl<'de> Deserialize<'de> for KeyIdentifier
impl<'de> Deserialize<'de> for KeyIdentifier
source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for KeyIdentifier
impl Display for KeyIdentifier
source§impl From<KeyIdentifier> for [u8; 20]
impl From<KeyIdentifier> for [u8; 20]
source§fn from(src: KeyIdentifier) -> Self
fn from(src: KeyIdentifier) -> Self
Converts to this type from the input type.
source§impl FromStr for KeyIdentifier
impl FromStr for KeyIdentifier
source§impl Hash for KeyIdentifier
impl Hash for KeyIdentifier
source§impl Ord for KeyIdentifier
impl Ord for KeyIdentifier
source§fn cmp(&self, other: &KeyIdentifier) -> Ordering
fn cmp(&self, other: &KeyIdentifier) -> 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 PartialOrd for KeyIdentifier
impl PartialOrd for KeyIdentifier
source§fn partial_cmp(&self, other: &KeyIdentifier) -> Option<Ordering>
fn partial_cmp(&self, other: &KeyIdentifier) -> 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 moresource§impl PrimitiveContent for KeyIdentifier
impl PrimitiveContent for KeyIdentifier
source§fn encoded_len(&self, _mode: Mode) -> usize
fn encoded_len(&self, _mode: Mode) -> usize
Returns the length of the encoded content of this type.
source§fn write_encoded<W: Write>(
&self,
_mode: Mode,
target: &mut W
) -> Result<(), Error>
fn write_encoded<W: Write>( &self, _mode: Mode, target: &mut W ) -> Result<(), Error>
Writes the encoded content to a writer.
source§fn to_encoded_bytes(&self, mode: Mode) -> Bytes
fn to_encoded_bytes(&self, mode: Mode) -> Bytes
Encodes the value to bytes (useful when you need to sign a structure)
source§fn encode(self) -> Primitive<Self>
fn encode(self) -> Primitive<Self>
Returns a value encoder for this content using the natural tag. Read more
source§fn encode_as(self, tag: Tag) -> Primitive<Self>
fn encode_as(self, tag: Tag) -> Primitive<Self>
Returns a value encoder for this content using the given tag. Read more
source§fn encode_ref(&self) -> Primitive<&Self>
fn encode_ref(&self) -> Primitive<&Self>
Returns a value encoder for a reference using the natural tag.
source§impl Serialize for KeyIdentifier
impl Serialize for KeyIdentifier
source§impl<'a> TryFrom<&'a [u8]> for KeyIdentifier
impl<'a> TryFrom<&'a [u8]> for KeyIdentifier
impl Copy for KeyIdentifier
impl Eq for KeyIdentifier
impl StructuralEq for KeyIdentifier
Auto Trait Implementations§
impl RefUnwindSafe for KeyIdentifier
impl Send for KeyIdentifier
impl Sync for KeyIdentifier
impl Unpin for KeyIdentifier
impl UnwindSafe for KeyIdentifier
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
source§impl<T> Text for Twhere
T: Display,
impl<T> Text for Twhere
T: Display,
source§fn write_escaped(
&self,
mode: TextEscape,
target: &mut impl Write
) -> Result<(), Error>
fn write_escaped( &self, mode: TextEscape, target: &mut impl Write ) -> Result<(), Error>
Write text escaped for the given mode to
target
.