Struct osshkeys::keys::ed25519::Ed25519KeyPair
source · pub struct Ed25519KeyPair { /* private fields */ }
Expand description
Represent the Ed25519 key pair
Implementations§
source§impl Ed25519KeyPair
impl Ed25519KeyPair
sourcepub fn generate(bits: usize) -> OsshResult<Self>
pub fn generate(bits: usize) -> OsshResult<Self>
Generate Ed25519 key pair
The bits parameter should be 256 bits or 0
to use default length (256 bits).
sourcepub fn clone_public_key(&self) -> Result<Ed25519PublicKey, Error>
pub fn clone_public_key(&self) -> Result<Ed25519PublicKey, Error>
Clone the public parts to generate public key
Trait Implementations§
source§impl From<Ed25519KeyPair> for KeyPair
impl From<Ed25519KeyPair> for KeyPair
source§fn from(inner: Ed25519KeyPair) -> KeyPair
fn from(inner: Ed25519KeyPair) -> KeyPair
Converts to this type from the input type.
source§impl Key for Ed25519KeyPair
impl Key for Ed25519KeyPair
source§impl PrivateParts for Ed25519KeyPair
impl PrivateParts for Ed25519KeyPair
source§impl PublicParts for Ed25519KeyPair
impl PublicParts for Ed25519KeyPair
source§fn verify(&self, data: &[u8], sig: &[u8]) -> Result<bool, Error>
fn verify(&self, data: &[u8], sig: &[u8]) -> Result<bool, Error>
Verify the data with a detached signature, returning true if the signature is not malformed
source§fn fingerprint(&self, hash: FingerprintHash) -> OsshResult<Vec<u8>>
fn fingerprint(&self, hash: FingerprintHash) -> OsshResult<Vec<u8>>
Hash the blob of the public key to generate the fingerprint
source§fn fingerprint_randomart(&self, hash: FingerprintHash) -> OsshResult<String>
fn fingerprint_randomart(&self, hash: FingerprintHash) -> OsshResult<String>
Draw an ASCII-art picture from the fingerprint, also known as “randomart”
Auto Trait Implementations§
impl RefUnwindSafe for Ed25519KeyPair
impl Send for Ed25519KeyPair
impl Sync for Ed25519KeyPair
impl Unpin for Ed25519KeyPair
impl UnwindSafe for Ed25519KeyPair
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