pub enum PublicKey {
Rsa(RSAPublicKey),
Secp256k1(PublicKey),
Invalid,
}
Variants
Rsa(RSAPublicKey)
Secp256k1(PublicKey)
Invalid
Implementations
sourceimpl 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
sourceimpl<'a> From<&'a PublicKey> for PublicKeyRef<'a>
impl<'a> From<&'a PublicKey> for PublicKeyRef<'a>
sourceimpl ObjectFormat for PublicKey
impl ObjectFormat for PublicKey
fn format_json(&self) -> Value
sourceimpl 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
sourceimpl PublicKeyObjectDesc for PublicKey
impl PublicKeyObjectDesc for PublicKey
fn public_key_ref(&self) -> Option<PublicKeyRef<'_>>
sourceimpl<'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])>
sourceimpl 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>>
sourceimpl RawFixedBytes for PublicKey
impl RawFixedBytes for PublicKey
sourceimpl SingleKeyObjectDesc for PublicKey
impl SingleKeyObjectDesc for PublicKey
fn public_key(&self) -> &PublicKey
sourceimpl SubDescType for PublicKey
impl SubDescType for PublicKey
PublicKey
用于SingleKeyObjectDesc
fn is_none(&self) -> bool
fn inner_raw_measure(
&self,
purpose: &Option<RawEncodePurpose>
) -> Result<usize, BuckyError>
fn inner_raw_encode<'a>(
&self,
buf: &'a mut [u8],
purpose: &Option<RawEncodePurpose>
) -> Result<&'a mut [u8], BuckyError>
fn inner_raw_decode<'de>(
buf: &'de [u8]
) -> Result<(Self, &'de [u8]), BuckyError>
fn is_some(&self) -> bool
impl Eq for PublicKey
impl StructuralEq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more