pub fn try_key_as_pubkey(key: &PSBTKey) -> Result<VerifyingKey, PSBTError> {
    if key.len() != 34 {
        return Err(PSBTError::WrongKeyLength {
            expected: 34,
            got: key.len(),
        });
    }
    let mut buf = [0u8; 33];
    buf.copy_from_slice(&key.items()[1..]);
    Ok(VerifyingKey::from_sec1_bytes(&buf).map_err(Bip32Error::from)?)
}
/// Attempt to parse a keyas a Secp256k1 pybkey
Attempt to parse a keyas a Secp256k1 pybkey
Attempt to parse a keyas a Secp256k1 pybkey
pub fn try_key_as_pubkey(key: &PSBTKey) -> Result<VerifyingKey, PSBTError> {
    if key.len() != 34 {
        return Err(PSBTError::WrongKeyLength {
            expected: 34,
            got: key.len(),
        });
    }
    let mut buf = [0u8; 33];
    buf.copy_from_slice(&key.items()[1..]);
    Ok(VerifyingKey::from_sec1_bytes(&buf).map_err(Bip32Error::from)?)
}
pub fn try_key_as_pubkey ( key : & PSBTKey ) -> Result < VerifyingKey , PSBTError > { if key . len ( ) != 34 { return Err ( PSBTError :: WrongKeyLength { expected : 34 , got : key . len ( ) , } ) ; } let mut buf = [ 0u8 ; 33 ] ; buf . copy_from_slice ( & key . items ( ) [ 1 .. ] ) ; Ok ( VerifyingKey :: from_sec1_bytes ( & buf ) . map_err ( Bip32Error :: from ) ? ) }
Attempt to parse a keyas a Secp256k1 pybkey
Attempt to parse a keyas a Secp256k1 pybkey
key
&PSBTKey
key
&PSBTKey