[−][src]Struct ripple_keypairs::PrivateKey
A private key that can be used to sign messages
Examples
use ripple_keypairs::Seed; let seed = "sp5fghtJtpUorTwvof1NpDXAzNwf5".parse::<Seed>()?; let (private_key, _) = seed.derive_keypair()?; let signature = private_key.sign(&"test message"); assert_eq!(signature.to_string(), "30440220583A91C95E54E6A651C47BEC22744E0B101E2C4060E7B08F6341657DAD9BC3EE02207D1489C7395DB0188D3A56A977ECBA54B36FA9371B40319655B1B4429E33EF2D"); assert_eq!(signature.into(), vec![48, 68, 2, 32, 88, 58, 145, 201, 94, 84, 230, 166, 81, 196, 123, 236, 34, 116, 78, 11, 16, 30, 44, 64, 96, 231, 176, 143, 99, 65, 101, 125, 173, 155, 195, 238, 2, 32, 125, 20, 137, 199, 57, 93, 176, 24, 141, 58, 86, 169, 119, 236, 186, 84, 179, 111, 169, 55, 27, 64, 49, 150, 85, 177, 180, 66, 158, 51, 239, 45]); assert_eq!(private_key.to_string(), "00D78B9735C3F26501C7337B8A5727FD53A6EFDBC6AA55984F098488561F985E23");
Implementations
impl PrivateKey
[src]
pub fn sign(&self, message: &impl AsRef<[u8]>) -> impl Signature
[src]
Sign message
Returns the Signature
which that can be treated
as bytes or as a hex encoded string.
Trait Implementations
impl Clone for PrivateKey
[src]
fn clone(&self) -> PrivateKey
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PrivateKey
[src]
impl Display for PrivateKey
[src]
impl Eq for PrivateKey
[src]
impl Hash for PrivateKey
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<PrivateKey> for PrivateKey
[src]
fn eq(&self, other: &PrivateKey) -> bool
[src]
fn ne(&self, other: &PrivateKey) -> bool
[src]
impl StructuralEq for PrivateKey
[src]
impl StructuralPartialEq for PrivateKey
[src]
Auto Trait Implementations
impl RefUnwindSafe for PrivateKey
[src]
impl Send for PrivateKey
[src]
impl Sync for PrivateKey
[src]
impl Unpin for PrivateKey
[src]
impl UnwindSafe for PrivateKey
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,