Trait KeyGenOps
pub trait KeyGenOps {
// Required methods
fn compute_public_key(
&self,
private_key: &PrivateKey,
) -> Result<PublicKey, RecryptErr>;
fn random_private_key(&self) -> PrivateKey;
fn generate_key_pair(&self) -> Result<(PrivateKey, PublicKey), RecryptErr>;
fn generate_transform_key(
&self,
from_private_key: &PrivateKey,
to_public_key: &PublicKey,
signing_keypair: &SigningKeypair,
) -> Result<TransformKey, RecryptErr>;
}
Expand description
Key generation operations
Required Methods§
fn compute_public_key(
&self,
private_key: &PrivateKey,
) -> Result<PublicKey, RecryptErr>
fn compute_public_key( &self, private_key: &PrivateKey, ) -> Result<PublicKey, RecryptErr>
Compute a PublicKey
given a PrivateKey
fn random_private_key(&self) -> PrivateKey
fn random_private_key(&self) -> PrivateKey
Generate a random private key.
Relies on Api::random_bytes
to generate cryptographically secure random bytes
fn generate_key_pair(&self) -> Result<(PrivateKey, PublicKey), RecryptErr>
fn generate_key_pair(&self) -> Result<(PrivateKey, PublicKey), RecryptErr>
Generate a public/private keypair.
Relies on Api::random_bytes
to generate cryptographically secure random bytes
fn generate_transform_key(
&self,
from_private_key: &PrivateKey,
to_public_key: &PublicKey,
signing_keypair: &SigningKeypair,
) -> Result<TransformKey, RecryptErr>
fn generate_transform_key( &self, from_private_key: &PrivateKey, to_public_key: &PublicKey, signing_keypair: &SigningKeypair, ) -> Result<TransformKey, RecryptErr>
Generate a transform key which is used to delegate to the to_public_key
from the from_private_key
.
§Arguments
from_private_key
- key that can currently decrypt the value. (delegator)to_public_key
- key that we want to let decrypt the value. (delegatee)from_signing_keypair
- The signing keypair of the person (or device) who is generating this transform key
§Return
Key which allows a proxy to compute the transform. See EncryptOps.transform
.