[−]Trait recrypt::api::KeyGenOps
Key generation operations
Required methods
fn compute_public_key(
&self,
private_key: &PrivateKey
) -> Result<PublicKey, RecryptErr>
&self,
private_key: &PrivateKey
) -> Result<PublicKey, RecryptErr>
Compute a PublicKey
given a 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>
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>
&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
.
Implementors
impl<R: RandomBytesGen, H: Sha256Hashing, S: Ed25519Signing> KeyGenOps for Recrypt<H, S, R>
fn compute_public_key(
&self,
private_key: &PrivateKey
) -> Result<PublicKey, RecryptErr>
&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>
&self,
from_private_key: &PrivateKey,
to_public_key: &PublicKey,
signing_keypair: &SigningKeypair
) -> Result<TransformKey, RecryptErr>