pub struct SignatureKeyPair { /* private fields */ }
Expand description

A signature key pair for the basic credential.

This can be used as keys to implement the MLS basic credential. It is a simple private and public key pair with corresponding signature scheme.

Implementations§

source§

impl SignatureKeyPair

source

pub fn new(signature_scheme: SignatureScheme) -> Result<Self, CryptoError>

Generates a fresh signature keypair using the SignatureScheme.

source

pub fn from_raw( signature_scheme: SignatureScheme, private: Vec<u8>, public: Vec<u8> ) -> Self

Create a new signature key pair from the raw keys.

source

pub fn store<T>( &self, key_store: &T ) -> Result<(), <T as OpenMlsKeyStore>::Error>where T: OpenMlsKeyStore,

Store this signature key pair in the key store.

source

pub fn read( key_store: &impl OpenMlsKeyStore, public_key: &[u8], signature_scheme: SignatureScheme ) -> Option<Self>

Read a signature key pair from the key store.

source

pub fn public(&self) -> &[u8]

Get the public key as byte slice.

source

pub fn to_public_vec(&self) -> Vec<u8>

Get the public key as byte vector.

source

pub fn signature_scheme(&self) -> SignatureScheme

Get the SignatureScheme of this signature key.

Trait Implementations§

source§

impl Debug for SignatureKeyPair

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for SignatureKeyPair

source§

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 Deserialize for SignatureKeyPair

source§

fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>

This function deserializes the bytes from the provided a std::io::Read and returns the populated struct. Read more
source§

fn tls_deserialize_exact(bytes: impl AsRef<[u8]>) -> Result<Self, Error>where Self: Sized,

This function deserializes the provided bytes and returns the populated struct. All bytes must be consumed. Read more
source§

fn tls_deserialize_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, Error>where Self: Sized,

This function deserializes the provided bytes and returns the populated struct. Read more
source§

impl MlsEntity for SignatureKeyPair

source§

const ID: MlsEntityId = MlsEntityId::SignatureKeyPair

Identifier used to downcast the actual entity within an OpenMlsKeyStore method. In case for example you need to select a SQL table depending on the entity type
source§

impl Serialize for &SignatureKeyPair

source§

fn tls_serialize<W: Write>(&self, writer: &mut W) -> Result<usize, Error>

Serialize self and write it to the writer. The function returns the number of bytes written to writer.
source§

fn tls_serialize_detached(&self) -> Result<Vec<u8, Global>, Error>

Serialize self and return it as a byte vector.
source§

impl Serialize for SignatureKeyPair

source§

fn tls_serialize<W: Write>(&self, writer: &mut W) -> Result<usize, Error>

Serialize self and write it to the writer. The function returns the number of bytes written to writer.
source§

fn tls_serialize_detached(&self) -> Result<Vec<u8, Global>, Error>

Serialize self and return it as a byte vector.
source§

impl Serialize for SignatureKeyPair

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Signer for SignatureKeyPair

source§

fn sign(&self, payload: &[u8]) -> Result<Vec<u8>, Error>

Sign the provided payload. Read more
source§

fn signature_scheme(&self) -> SignatureScheme

The SignatureScheme of this signer.
source§

impl Size for &SignatureKeyPair

source§

impl Size for SignatureKeyPair

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,