pub struct SignedPublicKeyMessage {
algorithm: PublicKeyEncryptionAlgorithm,
content_format: PublicKeyFormat,
public_key: ByteBuf,
}
Expand description
SignedAsymmetricPublicKeyMessage
is a message that once signed, makes a claim towards owning a
public encryption key.
Fields§
§algorithm: PublicKeyEncryptionAlgorithm
The algorithm/crypto system used with this public key.
content_format: PublicKeyFormat
The format of the public key.
public_key: ByteBuf
The public key, serialized and formatted in the content format specified in
content_format
.
Note: ByteBuf is used here to ensure efficient serialization. Using Vec<u8>
would
lead to an incompatible encoding of individual bytes, instead of a contiguous byte
buffer.
Implementations§
Source§impl SignedPublicKeyMessage
impl SignedPublicKeyMessage
Sourcepub fn from_public_key(
public_key: &AsymmetricPublicCryptoKey,
) -> Result<Self, CryptoError>
pub fn from_public_key( public_key: &AsymmetricPublicCryptoKey, ) -> Result<Self, CryptoError>
Creates a new SignedPublicKeyMessage
from an AsymmetricPublicCryptoKey
. This message
can then be signed using a SigningKey
to create a SignedPublicKey
.
Sourcepub fn sign(
&self,
signing_key: &SigningKey,
) -> Result<SignedPublicKey, CryptoError>
pub fn sign( &self, signing_key: &SigningKey, ) -> Result<SignedPublicKey, CryptoError>
Signs the SignedPublicKeyMessage
using the provided SigningKey
, and returns a
SignedPublicKey
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SignedPublicKeyMessage
impl<'de> Deserialize<'de> for SignedPublicKeyMessage
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
Auto Trait Implementations§
impl Freeze for SignedPublicKeyMessage
impl RefUnwindSafe for SignedPublicKeyMessage
impl Send for SignedPublicKeyMessage
impl Sync for SignedPublicKeyMessage
impl Unpin for SignedPublicKeyMessage
impl UnwindSafe for SignedPublicKeyMessage
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
Read moreSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more