emerald-hwkey 0.3.0

Emerald HWKey - Harware Cryptocurrency Key Access
Documentation
1
2
3
4
5
6
7
use bitcoin::secp256k1::PublicKey;
use crate::errors::HWKeyError;

pub fn as_compact(pubkey: &PublicKey) -> Result<PublicKey, HWKeyError> {
    PublicKey::from_slice(&pubkey.serialize())
        .map_err(|_| HWKeyError::CryptoError("Invalid public key".to_string()))
}