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.
pub fn id(&self) -> StorageId
Sourcepub fn store<T>(&self, store: &T) -> Result<(), T::Error>where
T: StorageProvider<CURRENT_VERSION>,
pub fn store<T>(&self, store: &T) -> Result<(), T::Error>where
T: StorageProvider<CURRENT_VERSION>,
Store this signature key pair in the key store.
Sourcepub fn read(
store: &impl StorageProvider<CURRENT_VERSION>,
public_key: &[u8],
signature_scheme: SignatureScheme,
) -> Option<Self>
pub fn read( store: &impl StorageProvider<CURRENT_VERSION>, public_key: &[u8], signature_scheme: SignatureScheme, ) -> Option<Self>
Read a signature key pair from the key store.
Sourcepub fn delete<T: StorageProvider<CURRENT_VERSION>>(
store: &T,
public_key: &[u8],
signature_scheme: SignatureScheme,
) -> Result<(), T::Error>
pub fn delete<T: StorageProvider<CURRENT_VERSION>>( store: &T, public_key: &[u8], signature_scheme: SignatureScheme, ) -> Result<(), T::Error>
Delete 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 DeserializeBytes for SignatureKeyPair
impl DeserializeBytes for SignatureKeyPair
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 sign(&self, payload: &[u8]) -> Result<Vec<u8>, SignerError>
fn sign(&self, payload: &[u8]) -> Result<Vec<u8>, SignerError>
Sign the provided payload. Read more
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
impl Entity<CURRENT_VERSION> for SignatureKeyPair
impl SignatureKeyPair<CURRENT_VERSION> for SignatureKeyPair
Auto Trait Implementations§
impl Freeze for SignatureKeyPair
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