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
impl SignatureKeyPair
sourcepub fn new(signature_scheme: SignatureScheme) -> Result<Self, CryptoError>
pub fn new(signature_scheme: SignatureScheme) -> Result<Self, CryptoError>
Generates a fresh signature keypair using the SignatureScheme.
sourcepub fn from_raw(
signature_scheme: SignatureScheme,
private: Vec<u8>,
public: Vec<u8>
) -> Self
pub fn from_raw( signature_scheme: SignatureScheme, private: Vec<u8>, public: Vec<u8> ) -> Self
Create a new signature key pair from the raw keys.
sourcepub fn store<T>(
&self,
key_store: &T
) -> Result<(), <T as OpenMlsKeyStore>::Error>where
T: OpenMlsKeyStore,
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.
sourcepub fn read(
key_store: &impl OpenMlsKeyStore,
public_key: &[u8],
signature_scheme: SignatureScheme
) -> Option<Self>
pub fn read( key_store: &impl OpenMlsKeyStore, public_key: &[u8], signature_scheme: SignatureScheme ) -> Option<Self>
Read a signature key pair from the key store.
sourcepub fn to_public_vec(&self) -> Vec<u8>
pub fn to_public_vec(&self) -> Vec<u8>
Get the public key as byte vector.
sourcepub fn signature_scheme(&self) -> SignatureScheme
pub fn signature_scheme(&self) -> SignatureScheme
Get the SignatureScheme of this signature key.
Trait Implementations§
source§impl Debug for SignatureKeyPair
impl Debug for SignatureKeyPair
source§impl<'de> Deserialize<'de> for SignatureKeyPair
impl<'de> Deserialize<'de> for SignatureKeyPair
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 Deserialize for SignatureKeyPair
impl Deserialize for SignatureKeyPair
source§fn tls_deserialize<R: Read>(bytes: &mut R) -> Result<Self, Error>
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 moresource§impl MlsEntity for SignatureKeyPair
impl MlsEntity for SignatureKeyPair
source§const ID: MlsEntityId = MlsEntityId::SignatureKeyPair
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
impl Serialize for &SignatureKeyPair
source§impl Serialize for SignatureKeyPair
impl Serialize for SignatureKeyPair
source§impl Serialize for SignatureKeyPair
impl Serialize for SignatureKeyPair
source§impl Signer for SignatureKeyPair
impl Signer for SignatureKeyPair
source§fn signature_scheme(&self) -> SignatureScheme
fn signature_scheme(&self) -> SignatureScheme
The
SignatureScheme of this signer.source§impl Size for &SignatureKeyPair
impl Size for &SignatureKeyPair
fn tls_serialized_len(&self) -> usize
source§impl Size for SignatureKeyPair
impl Size for SignatureKeyPair
fn tls_serialized_len(&self) -> usize
Auto Trait Implementations§
impl RefUnwindSafe for SignatureKeyPair
impl Send for SignatureKeyPair
impl Sync for SignatureKeyPair
impl Unpin for SignatureKeyPair
impl UnwindSafe for SignatureKeyPair
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