Struct sn_dbc::PublicKey [−][src]
pub struct PublicKey(_);
Expand description
A public key.
Implementations
impl PublicKey
[src]
impl PublicKey
[src]pub fn verify_g2<H>(&self, sig: &Signature, hash: H) -> bool where
H: Into<G2Affine>,
[src]
pub fn verify_g2<H>(&self, sig: &Signature, hash: H) -> bool where
H: Into<G2Affine>,
[src]Returns true
if the signature matches the element of G2
.
pub fn verify<M>(&self, sig: &Signature, msg: M) -> bool where
M: AsRef<[u8]>,
[src]
pub fn verify<M>(&self, sig: &Signature, msg: M) -> bool where
M: AsRef<[u8]>,
[src]Returns true
if the signature matches the message.
This is equivalent to verify_g2(sig, hash_g2(msg))
.
pub fn encrypt<M>(&self, msg: M) -> Ciphertext where
M: AsRef<[u8]>,
[src]
pub fn encrypt<M>(&self, msg: M) -> Ciphertext where
M: AsRef<[u8]>,
[src]Encrypts the message using the OS random number generator.
Uses the OsRng
by default. To pass in a custom random number generator, use
encrypt_with_rng()
.
pub fn encrypt_with_rng<R, M>(&self, rng: &mut R, msg: M) -> Ciphertext where
R: RngCore,
M: AsRef<[u8]>,
[src]
pub fn encrypt_with_rng<R, M>(&self, rng: &mut R, msg: M) -> Ciphertext where
R: RngCore,
M: AsRef<[u8]>,
[src]Encrypts the message.
pub fn from_bytes<B>(bytes: B) -> Result<PublicKey, FromBytesError> where
B: Borrow<[u8; 48]>,
[src]
pub fn from_bytes<B>(bytes: B) -> Result<PublicKey, FromBytesError> where
B: Borrow<[u8; 48]>,
[src]Returns the key with the given representation, if valid.
Trait Implementations
impl<'de> Deserialize<'de> for PublicKey
[src]
impl<'de> Deserialize<'de> for PublicKey
[src]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PublicKey, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<PublicKey, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Ord for PublicKey
[src]
impl Ord for PublicKey
[src]impl PartialOrd<PublicKey> for PublicKey
[src]
impl PartialOrd<PublicKey> for PublicKey
[src]pub fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &PublicKey) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Serialize for PublicKey
[src]
impl Serialize for PublicKey
[src]pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
impl Copy for PublicKey
[src]
impl Eq for PublicKey
[src]
impl StructuralEq for PublicKey
[src]
impl StructuralPartialEq for PublicKey
[src]
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
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,