pub enum PublicKey {
Ed25519(VerifyingKey),
Secp256k1(VerifyingKey),
P256(VerifyingKey),
P384(VerifyingKey),
}Expand description
Variants§
Implementations§
Source§impl PublicKey
impl PublicKey
pub fn from_bytes(key_type: PublicKeyType, bytes: &[u8]) -> Result<PublicKey>
pub fn from_ed25519_bytes(bytes: &[u8; 32]) -> Result<PublicKey>
pub fn from_secp256k1_bytes(bytes: &[u8]) -> Result<PublicKey>
pub fn decode(bytes: &[u8]) -> Result<PublicKey>
pub fn encode(&self) -> Vec<u8> ⓘ
pub fn key_type(&self) -> PublicKeyType
Source§impl PublicKey
impl PublicKey
Sourcepub fn verify_reader(
&self,
reader: &mut impl Read,
signature: &[u8],
) -> Result<()>
Available on crate feature std only.
pub fn verify_reader( &self, reader: &mut impl Read, signature: &[u8], ) -> Result<()>
std only.Verify the signature of the data from std::io::Read using PrivateKey
Trait Implementations§
impl Copy for PublicKey
Source§impl<'d> Deserialize<'d> for PublicKey
impl<'d> Deserialize<'d> for PublicKey
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'d>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'d>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PublicKey
Source§impl From<VerifyingKey> for PublicKey
impl From<VerifyingKey> for PublicKey
Source§fn from(pk: VerifyingKey) -> Self
fn from(pk: VerifyingKey) -> Self
Converts to this type from the input type.
Source§impl Ord for PublicKey
impl Ord for PublicKey
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for PublicKey
impl PartialOrd for PublicKey
Source§impl TryFrom<PublicKey> for VerifyingKey
impl TryFrom<PublicKey> for VerifyingKey
Source§impl TryFrom<PublicKey> for VerifyingKey
impl TryFrom<PublicKey> for VerifyingKey
Source§impl TryFrom<PublicKey> for VerifyingKey
impl TryFrom<PublicKey> for VerifyingKey
Source§impl TryFrom<PublicKey> for VerifyingKey
impl TryFrom<PublicKey> for VerifyingKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Seal for Twhere
T: Serialize + DeserializeOwned,
impl<T> Seal for Twhere
T: Serialize + DeserializeOwned,
Source§fn seal(&self) -> Result<(PrivateKey, Package<T>), Error>
fn seal(&self) -> Result<(PrivateKey, Package<T>), Error>
Encrypt with a freshly generated
PrivateKey, returning it alongside the PackageSource§fn seal_with(&self, private_key: &PrivateKey) -> Result<Package<T>, Error>
fn seal_with(&self, private_key: &PrivateKey) -> Result<Package<T>, Error>
Encrypt with the supplied
PrivateKeyEncrypt for the given recipients using the supplied sender
PrivateKey