pub struct Keypair {
pub inner: KeypairOrPublicKey,
}
Fields§
§inner: KeypairOrPublicKey
Implementations§
Source§impl Keypair
impl Keypair
pub fn new(key: KeypairOrPublicKey) -> Self
pub fn generate() -> Result<Self>
pub async fn as_ssh_private_pem(&self, _comment: &str) -> Result<String>
pub fn as_ssh_dot_pub(&self, _comment: &str) -> Result<String>
pub fn from_libp2p_keypair(keypair: Keypair) -> Result<Self>
pub fn from_ssh_dot_pub(_public_key_str: &str, _key_type: &str) -> Result<Self>
pub fn private_key(&self) -> String
pub fn public_key_as_base58_identity(&self) -> String
pub fn as_public_key_id(&self) -> String
pub fn as_public_address(&self) -> String
pub fn public_key_as_base64_pad(&self) -> String
pub fn private_key_as_base64_pad(&self) -> Result<String>
pub fn public_key_to_multiaddr_string(&self) -> String
pub fn as_public_multiaddress(&self) -> String
pub fn from_public_key(public_key_id: &str, key_type: &str) -> Result<Self>
pub fn from_public_multiaddress(multiaddress: &str) -> Result<Self>
pub fn from_json(json: &KeypairJSON) -> Result<Self>
pub fn from_json_string(json_str: &str) -> Result<Self>
pub fn from_encrypted_json_file(filepath: &str, password: &str) -> Result<Self>
pub fn from_json_file(filepath: &str) -> Result<Self>
pub fn as_public_json(&self) -> Result<KeypairJSON>
pub fn as_public_json_string(&self) -> Result<String>
pub fn as_public_json_file(&self, path: &str) -> Result<()>
pub fn as_json(&self) -> Result<KeypairJSON>
pub fn as_json_string(&self) -> Result<String>
pub fn as_json_file(&self, path: &str) -> Result<()>
pub fn as_encrypted_json(&self, password: &str) -> Result<KeypairJSON>
pub fn as_encrypted_json_string(&self, password: &str) -> Result<String>
pub fn as_encrypted_json_file(&self, path: &str, password: &str) -> Result<()>
pub fn sign_bytes(&self, bytes: &[u8]) -> Result<Vec<u8>>
pub fn sign_string(&self, s: &str) -> Result<Vec<u8>>
pub fn sign_string_as_base64_pad(&self, s: &str) -> Result<String>
pub fn sign_json(&self, json: &Value) -> Result<String>
pub fn sign_json_element( &self, json: &mut Value, name: &str, suffix: &str, ) -> Result<()>
pub fn sign_json_as_key(&self, json: &mut Value, key: &str) -> Result<()>
pub fn verify_signature_for_bytes( &self, signature: &str, bytes: &[u8], ) -> Result<bool>
pub fn verify_signature_for_string( &self, signature: &str, s: &str, ) -> Result<bool>
pub fn verify_json(&self, signature: &str, json: &Value) -> Result<bool>
pub fn verify_json_with_signature_key( &self, json: &Value, signature_key: &str, ) -> Result<bool>
pub fn verify_signatures_in_json( &self, json: &Value, suffix: Option<&str>, ) -> Result<bool>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keypair
impl RefUnwindSafe for Keypair
impl Send for Keypair
impl Sync for Keypair
impl Unpin for Keypair
impl UnwindSafe for Keypair
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more