pub struct KeyPair { /* private fields */ }👎Deprecated since 1.4.0: Use SoftwareKeyStore for new code. KeyPair will be removed in v2.0.0
Expand description
Legacy KeyPair wrapper for backward compatibility
DEPRECATED in v1.4.0: Use SoftwareKeyStore directly instead.
This struct maintains API compatibility with Hope Genome v1.3.0 code.
It wraps SoftwareKeyStore but provides the old interface.
v1.4.1 Note: Now benefits from P0/P2/P3 security enhancements!
§Migration Guide
// Old (v1.3.0)
use _hope_core::crypto::KeyPair;
let keypair = KeyPair::generate().unwrap();
// New (v1.4.1)
use _hope_core::crypto::SoftwareKeyStore;
let key_store = SoftwareKeyStore::generate().unwrap();Implementations§
Source§impl KeyPair
impl KeyPair
Sourcepub fn verify(&self, data: &[u8], signature: &[u8]) -> Result<()>
pub fn verify(&self, data: &[u8], signature: &[u8]) -> Result<()>
Verify signature with public key
Sourcepub fn public_key(&self) -> Vec<u8> ⓘ
pub fn public_key(&self) -> Vec<u8> ⓘ
Get public key (for backward compatibility)
Sourcepub fn as_key_store(&self) -> &SoftwareKeyStore
pub fn as_key_store(&self) -> &SoftwareKeyStore
Get underlying KeyStore (for migration to new API)
Trait Implementations§
Source§impl KeyStore for KeyPair
impl KeyStore for KeyPair
Source§fn verify(&self, data: &[u8], signature: &[u8]) -> Result<()>
fn verify(&self, data: &[u8], signature: &[u8]) -> Result<()>
Verify signature with the public key Read more
Source§fn public_key_bytes(&self) -> Vec<u8> ⓘ
fn public_key_bytes(&self) -> Vec<u8> ⓘ
Get the public key bytes (for export, verification by others) Read more
Source§fn identifier(&self) -> String
fn identifier(&self) -> String
Get a human-readable identifier for this key store Read more
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