pub struct PublicKeyPoP(/* private fields */);Expand description
A public key with its proof of possession.
Implementations§
Source§impl PublicKeyPoP
impl PublicKeyPoP
Sourcepub fn verify(&self) -> Result<PublicKey, AtmsError>
pub fn verify(&self) -> Result<PublicKey, AtmsError>
Verify the proof of possession with respect to the associated public key, by checking that
$e(pk, H_2(b“PoP“)) = e(G_1, \texttt{self})$, where self is the proof of possession.
§Error
Returns InvalidPoP in case the proof is invalid.
§Example
let sk = SigningKey::gen(&mut OsRng);
let pkpop = PublicKeyPoP::from(&sk);
assert!(pkpop.verify().is_ok());Sourcepub fn to_bytes(&self) -> [u8; 144]
pub fn to_bytes(&self) -> [u8; 144]
Convert to a 144 byte string.
§Layout
The layout of a PublicKeyPoP encoding is
- Public key
- Proof of Possession
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, AtmsError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, AtmsError>
Deserialise a byte string to a PublicKeyPoP.
Trait Implementations§
Source§impl Clone for PublicKeyPoP
impl Clone for PublicKeyPoP
Source§fn clone(&self) -> PublicKeyPoP
fn clone(&self) -> PublicKeyPoP
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PublicKeyPoP
impl Debug for PublicKeyPoP
Source§impl From<&SigningKey> for PublicKeyPoP
Create a PublicKeyPoP by computing the public key and the proof of correctness and returning the
tuple.
impl From<&SigningKey> for PublicKeyPoP
Create a PublicKeyPoP by computing the public key and the proof of correctness and returning the
tuple.
Source§fn from(sk: &SigningKey) -> Self
fn from(sk: &SigningKey) -> Self
Converts to this type from the input type.
impl Copy for PublicKeyPoP
Auto Trait Implementations§
impl Freeze for PublicKeyPoP
impl RefUnwindSafe for PublicKeyPoP
impl Send for PublicKeyPoP
impl Sync for PublicKeyPoP
impl Unpin for PublicKeyPoP
impl UnsafeUnpin for PublicKeyPoP
impl UnwindSafe for PublicKeyPoP
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