pub struct ECVRFKeyPair {
pub pk: ECVRFPublicKey,
pub sk: ECVRFPrivateKey,
}Fields§
§pk: ECVRFPublicKey§sk: ECVRFPrivateKeyImplementations§
Source§impl ECVRFKeyPair
impl ECVRFKeyPair
pub fn public_key(&self) -> RistrettoPoint
Sourcepub fn secret_key_bytes(&self) -> [u8; 32]
pub fn secret_key_bytes(&self) -> [u8; 32]
Extract the secret key as a 32-byte array.
§Security Note
This exposes the raw secret key bytes. Handle with care and ensure proper zeroization of the returned bytes after use.
§Example
use vrf_wasm::vrf::ecvrf::ECVRFKeyPair;
use vrf_wasm::vrf::VRFKeyPair;
use vrf_wasm::rng::WasmRng;
let mut rng = WasmRng;
let keypair = ECVRFKeyPair::generate(&mut rng);
let secret_bytes = keypair.secret_key_bytes();
assert_eq!(secret_bytes.len(), 32);Trait Implementations§
Source§impl Debug for ECVRFKeyPair
impl Debug for ECVRFKeyPair
Source§impl<'de> Deserialize<'de> for ECVRFKeyPair
impl<'de> Deserialize<'de> for ECVRFKeyPair
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ECVRFKeyPair
Source§impl From<ECVRFPrivateKey> for ECVRFKeyPair
impl From<ECVRFPrivateKey> for ECVRFKeyPair
Source§fn from(sk: ECVRFPrivateKey) -> Self
fn from(sk: ECVRFPrivateKey) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ECVRFKeyPair
impl PartialEq for ECVRFKeyPair
Source§fn eq(&self, other: &ECVRFKeyPair) -> bool
fn eq(&self, other: &ECVRFKeyPair) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ECVRFKeyPair
impl Serialize for ECVRFKeyPair
impl StructuralPartialEq for ECVRFKeyPair
Source§impl VRFKeyPair<64> for ECVRFKeyPair
impl VRFKeyPair<64> for ECVRFKeyPair
type Proof = ECVRFProof
type PrivateKey = ECVRFPrivateKey
type PublicKey = ECVRFPublicKey
Source§fn generate<R: AllowedRng>(rng: &mut R) -> Self
fn generate<R: AllowedRng>(rng: &mut R) -> Self
Generate a new keypair using the given RNG.
Source§fn prove(&self, alpha_string: &[u8]) -> ECVRFProof
fn prove(&self, alpha_string: &[u8]) -> ECVRFProof
Generate a proof for the given input.
impl ZeroizeOnDrop for ECVRFKeyPair
Auto Trait Implementations§
impl Freeze for ECVRFKeyPair
impl RefUnwindSafe for ECVRFKeyPair
impl Send for ECVRFKeyPair
impl Sync for ECVRFKeyPair
impl Unpin for ECVRFKeyPair
impl UnsafeUnpin for ECVRFKeyPair
impl UnwindSafe for ECVRFKeyPair
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