Enum oasis_runtime_sdk::crypto::signature::MemorySigner
source · pub enum MemorySigner {
Ed25519(MemorySigner),
Secp256k1(MemorySigner),
Secp256r1(MemorySigner),
Secp384r1(MemorySigner),
Sr25519(MemorySigner),
}
Expand description
A memory-backed signer.
Variants§
Ed25519(MemorySigner)
Secp256k1(MemorySigner)
Secp256r1(MemorySigner)
Secp384r1(MemorySigner)
Sr25519(MemorySigner)
Implementations§
source§impl MemorySigner
impl MemorySigner
sourcepub fn new_from_seed(
sig_type: SignatureType,
seed: &[u8],
) -> Result<Self, Error>
pub fn new_from_seed( sig_type: SignatureType, seed: &[u8], ) -> Result<Self, Error>
Create a new memory signer from a seed.
sourcepub fn new_test(sig_type: SignatureType, name: &str) -> Self
pub fn new_test(sig_type: SignatureType, name: &str) -> Self
Create a new signer for testing purposes.
sourcepub fn from_bytes(sig_type: SignatureType, bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(sig_type: SignatureType, bytes: &[u8]) -> Result<Self, Error>
Reconstruct the signer from its byte representation.
sourcepub fn public_key(&self) -> PublicKey
pub fn public_key(&self) -> PublicKey
Public key corresponding to the signer.
sourcepub fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>
pub fn sign(&self, context: &[u8], message: &[u8]) -> Result<Signature, Error>
Generate a signature with the private key over the context and message.
sourcepub fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>
pub fn sign_raw(&self, message: &[u8]) -> Result<Signature, Error>
Generate a signature with the private key over the message.
sourcepub fn sign_by_type(
&self,
signature_type: SignatureType,
context_or_hash: &[u8],
message: &[u8],
) -> Result<Signature, Error>
pub fn sign_by_type( &self, signature_type: SignatureType, context_or_hash: &[u8], message: &[u8], ) -> Result<Signature, Error>
Generate a signature for the specified message and optional context.
Auto Trait Implementations§
impl Freeze for MemorySigner
impl RefUnwindSafe for MemorySigner
impl Send for MemorySigner
impl Sync for MemorySigner
impl Unpin for MemorySigner
impl UnwindSafe for MemorySigner
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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