Struct sc_keystore::LocalKeystore
source · pub struct LocalKeystore(/* private fields */);Expand description
A local based keystore that is either memory-based or filesystem-based.
Implementations§
source§impl LocalKeystore
impl LocalKeystore
Trait Implementations§
source§impl Into<Arc<dyn Keystore>> for LocalKeystore
impl Into<Arc<dyn Keystore>> for LocalKeystore
source§fn into(self) -> KeystorePtr
fn into(self) -> KeystorePtr
Converts this type into the (usually inferred) input type.
source§impl Keystore for LocalKeystore
impl Keystore for LocalKeystore
source§fn sr25519_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, TraitError>
fn sr25519_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, TraitError>
Generate a new pair compatible with the ‘ed25519’ signature scheme.
If [seed] is Some then the key will be ephemeral and stored in memory.
source§fn ed25519_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, TraitError>
fn ed25519_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, TraitError>
Generate a new pair compatible with the ‘sr25519’ signature scheme.
If [seed] is Some then the key will be ephemeral and stored in memory.
source§fn ecdsa_generate_new(
&self,
key_type: KeyTypeId,
seed: Option<&str>
) -> Result<Public, TraitError>
fn ecdsa_generate_new( &self, key_type: KeyTypeId, seed: Option<&str> ) -> Result<Public, TraitError>
Generate a new pair compatible with the ‘ecdsa’ signature scheme.
If [seed] is Some then the key will be ephemeral and stored in memory.
source§fn insert(
&self,
key_type: KeyTypeId,
suri: &str,
public: &[u8]
) -> Result<(), ()>
fn insert( &self, key_type: KeyTypeId, suri: &str, public: &[u8] ) -> Result<(), ()>
Insert a new secret key.
source§fn keys(&self, key_type: KeyTypeId) -> Result<Vec<Vec<u8>>, TraitError>
fn keys(&self, key_type: KeyTypeId) -> Result<Vec<Vec<u8>>, TraitError>
List all supported keys of a given type. Read more
source§fn has_keys(&self, public_keys: &[(Vec<u8>, KeyTypeId)]) -> bool
fn has_keys(&self, public_keys: &[(Vec<u8>, KeyTypeId)]) -> bool
Checks if the private keys for the given public key and key type combinations exist. Read more
source§fn sr25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn sr25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all the sr25519 public keys for the given key type.
source§fn sr25519_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, TraitError>
fn sr25519_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, TraitError>
Generate an sr25519 signature for a given message. Read more
source§fn sr25519_vrf_sign(
&self,
key_type: KeyTypeId,
public: &Public,
data: &VrfSignData
) -> Result<Option<VrfSignature>, TraitError>
fn sr25519_vrf_sign( &self, key_type: KeyTypeId, public: &Public, data: &VrfSignData ) -> Result<Option<VrfSignature>, TraitError>
Generate an sr25519 VRF signature for the given data. Read more
source§fn sr25519_vrf_output(
&self,
key_type: KeyTypeId,
public: &Public,
input: &VrfInput
) -> Result<Option<VrfOutput>, TraitError>
fn sr25519_vrf_output( &self, key_type: KeyTypeId, public: &Public, input: &VrfInput ) -> Result<Option<VrfOutput>, TraitError>
Generate an sr25519 VRF output for a given input data. Read more
source§fn ed25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn ed25519_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all ed25519 public keys for the given key type.
source§fn ed25519_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, TraitError>
fn ed25519_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, TraitError>
Generate an ed25519 signature for a given message. Read more
source§fn ecdsa_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
fn ecdsa_public_keys(&self, key_type: KeyTypeId) -> Vec<Public>
Returns all ecdsa public keys for the given key type.
source§fn ecdsa_sign(
&self,
key_type: KeyTypeId,
public: &Public,
msg: &[u8]
) -> Result<Option<Signature>, TraitError>
fn ecdsa_sign( &self, key_type: KeyTypeId, public: &Public, msg: &[u8] ) -> Result<Option<Signature>, TraitError>
Generate an ecdsa signature for a given message. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for LocalKeystore
impl Send for LocalKeystore
impl Sync for LocalKeystore
impl Unpin for LocalKeystore
impl UnwindSafe for LocalKeystore
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.