Enum near_crypto::SecretKey
source · pub enum SecretKey {
ED25519(ED25519SecretKey),
SECP256K1(SecretKey),
}
Expand description
Secret key container supporting different curves.
Variants§
ED25519(ED25519SecretKey)
SECP256K1(SecretKey)
Implementations§
source§impl SecretKey
impl SecretKey
pub fn key_type(&self) -> KeyType
pub fn from_random(key_type: KeyType) -> SecretKey
pub fn sign(&self, data: &[u8]) -> Signature
pub fn public_key(&self) -> PublicKey
pub fn unwrap_as_ed25519(&self) -> &ED25519SecretKey
Trait Implementations§
source§impl<'de> Deserialize<'de> for SecretKey
impl<'de> Deserialize<'de> for SecretKey
source§fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Self, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for SecretKey
impl PartialEq for SecretKey
source§impl Serialize for SecretKey
impl Serialize for SecretKey
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for SecretKey
impl StructuralEq for SecretKey
impl StructuralPartialEq for SecretKey
Auto Trait Implementations§
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
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