pub struct Pubkey { /* private fields */ }
Expand description
A public key object
Implementations§
Source§impl Pubkey
impl Pubkey
Sourcepub fn load_dsa(p: &MPI, q: &MPI, g: &MPI, y: &MPI) -> Result<Pubkey>
pub fn load_dsa(p: &MPI, q: &MPI, g: &MPI, y: &MPI) -> Result<Pubkey>
Load an DSA public key (p,q,g,y)
Sourcepub fn load_elgamal(p: &MPI, g: &MPI, y: &MPI) -> Result<Pubkey>
pub fn load_elgamal(p: &MPI, g: &MPI, y: &MPI) -> Result<Pubkey>
Load an ElGamal public key (p,g,y)
Sourcepub fn load_ecdsa(pub_x: &MPI, pub_y: &MPI, curve_name: &str) -> Result<Pubkey>
pub fn load_ecdsa(pub_x: &MPI, pub_y: &MPI, curve_name: &str) -> Result<Pubkey>
Load an ECDSA public key (x,y) for the specified curve
Sourcepub fn load_ecdh(pub_x: &MPI, pub_y: &MPI, curve_name: &str) -> Result<Pubkey>
pub fn load_ecdh(pub_x: &MPI, pub_y: &MPI, curve_name: &str) -> Result<Pubkey>
Load an ECDH public key (x,y) for the specified curve
Sourcepub fn load_ed25519(key: &[u8]) -> Result<Pubkey>
pub fn load_ed25519(key: &[u8]) -> Result<Pubkey>
Load an Ed25519 public key
Sourcepub fn load_x25519(key: &[u8]) -> Result<Pubkey>
pub fn load_x25519(key: &[u8]) -> Result<Pubkey>
Load an X25519 key
Sourcepub fn estimated_strength(&self) -> Result<usize>
pub fn estimated_strength(&self) -> Result<usize>
Return estimated bit strength of this key
Sourcepub fn check_key(&self, rng: &mut RandomNumberGenerator) -> Result<bool>
pub fn check_key(&self, rng: &mut RandomNumberGenerator) -> Result<bool>
Check key for problems
Sourcepub fn der_encode(&self) -> Result<Vec<u8>>
pub fn der_encode(&self) -> Result<Vec<u8>>
DER encode this public key
Sourcepub fn pem_encode(&self) -> Result<String>
pub fn pem_encode(&self) -> Result<String>
PEM encode this public key
Sourcepub fn get_field(&self, which: &str) -> Result<MPI>
pub fn get_field(&self, which: &str) -> Result<MPI>
Get a value for the public key The which parameter selects a field which is algorithm specific
Sourcepub fn get_ed25519_key(&self) -> Result<Vec<u8>>
pub fn get_ed25519_key(&self) -> Result<Vec<u8>>
Return the 32-byte Ed25519 public key
Sourcepub fn get_x25519_key(&self) -> Result<Vec<u8>>
pub fn get_x25519_key(&self) -> Result<Vec<u8>>
Get the X25519 public key
Trait Implementations§
impl Send for Pubkey
impl Sync for Pubkey
Auto Trait Implementations§
impl Freeze for Pubkey
impl RefUnwindSafe for Pubkey
impl Unpin for Pubkey
impl UnwindSafe for Pubkey
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