pub enum PublicKey {
Rsa(RSAPublicKey),
Secp256k1(PublicKey),
Invalid,
}
Variants§
Implementations§
source§impl PublicKey
impl PublicKey
pub fn key_type_str(&self) -> &str
pub fn key_size(&self) -> usize
pub fn encrypt(&self, data: &[u8], output: &mut [u8]) -> BuckyResult<usize>
pub fn encrypt_data(&self, data: &[u8]) -> BuckyResult<Vec<u8>>
pub fn gen_aeskey_and_encrypt(&self) -> BuckyResult<(AesKey, Vec<u8>)>
pub fn verify(&self, data: &[u8], sign: &Signature) -> bool
Trait Implementations§
source§impl<'a> From<&'a PublicKey> for PublicKeyRef<'a>
impl<'a> From<&'a PublicKey> for PublicKeyRef<'a>
source§impl ObjectFormat for PublicKey
impl ObjectFormat for PublicKey
fn format_json(&self) -> Value
source§impl PartialEq<PublicKey> for PublicKey
impl PartialEq<PublicKey> for PublicKey
source§impl PublicKeyObj for PublicKey
impl PublicKeyObj for PublicKey
fn from_type_less( single: Option<PublicKey>, mn: Option<MNPublicKey> ) -> BuckyResult<Self>
fn has_single_key(&self) -> bool
fn has_mn_key(&self) -> bool
source§impl PublicKeyObjectDesc for PublicKey
impl PublicKeyObjectDesc for PublicKey
fn public_key_ref(&self) -> Option<PublicKeyRef<'_>>
source§impl<'de> RawDecode<'de> for PublicKey
impl<'de> RawDecode<'de> for PublicKey
fn raw_decode(buf: &'de [u8]) -> Result<(Self, &'de [u8]), BuckyError>
fn raw_decode_with_option( buf: &'de [u8], _opt: &RawDecodeOption ) -> BuckyResult<(Self, &'de [u8])>
source§impl RawEncode for PublicKey
impl RawEncode for PublicKey
fn raw_measure( &self, _purpose: &Option<RawEncodePurpose> ) -> Result<usize, BuckyError>
fn raw_encode<'a>( &self, buf: &'a mut [u8], _purpose: &Option<RawEncodePurpose> ) -> Result<&'a mut [u8], BuckyError>
fn raw_tail_encode<'a>( &self, buf: &'a mut [u8], purpose: &Option<RawEncodePurpose> ) -> BuckyResult<&'a [u8]>
fn raw_encode_to_buffer(&self) -> BuckyResult<Vec<u8>>
fn raw_hash_value(&self) -> BuckyResult<HashValue>
fn hash_buf(&self, encoded_buf: &[u8]) -> HashValue
fn raw_hash_encode(&self) -> BuckyResult<Vec<u8>>
source§impl RawFixedBytes for PublicKey
impl RawFixedBytes for PublicKey
source§impl SingleKeyObjectDesc for PublicKey
impl SingleKeyObjectDesc for PublicKey
fn public_key(&self) -> &PublicKey
source§impl SubDescType for PublicKey
impl SubDescType for PublicKey
PublicKey
用于SingleKeyObjectDesc