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
pub fn to_spki_der(&self) -> BuckyResult<Vec<u8>>
pub fn to_pkcs1_der(&self) -> BuckyResult<Vec<u8>>
Trait Implementations§
Source§impl<'a> From<&'a PublicKey> for PublicKeyRef<'a>
impl<'a> From<&'a PublicKey> for PublicKeyRef<'a>
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, ) -> Result<(Self, &'de [u8]), BuckyError>
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>, ) -> Result<&'a [u8], BuckyError>
fn raw_encode_to_buffer(&self) -> Result<Vec<u8>, BuckyError>
fn raw_hash_encode(&self) -> Result<Vec<u8>, BuckyError>
Source§impl RawFixedBytes for PublicKey
impl RawFixedBytes for PublicKey
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnwindSafe for PublicKey
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