pub fn unseal(
        signature_alg: SignatureAlg,
        encryption_alg: EncryptionAlg,
        sealing_key: &[u8],
        sealed_keypair: &[u8],
    ) -> Result<KeyPair> {
        // Ed25519 is the only signature algorithm we presently support
        assert_eq!(signature_alg, SignatureAlg::Ed25519);

        let pkcs8_bytes = crypto::symmetric::unseal(encryption_alg, sealing_key, sealed_keypair)?;

        let keypair = ring::signature::Ed25519KeyPair::from_pkcs8(
            untrusted::Input::from(&pkcs8_bytes),
        ).chain_err(|| "not a valid Ed25519 keypair")?;

        Ok(KeyPair {
            algorithm: SignatureAlg::Ed25519,
            keypair: keypair,
        })
    }
/// Unseal an encrypted `KeyPair`
Unseal an encrypted `KeyPair`
Unseal an encrypted ` KeyPair `
pub fn unseal(
        signature_alg: SignatureAlg,
        encryption_alg: EncryptionAlg,
        sealing_key: &[u8],
        sealed_keypair: &[u8],
    ) -> Result<KeyPair> {
        // Ed25519 is the only signature algorithm we presently support
        assert_eq!(signature_alg, SignatureAlg::Ed25519);
        let pkcs8_bytes = crypto::symmetric::unseal(encryption_alg, sealing_key, sealed_keypair)?;
        let keypair = ring::signature::Ed25519KeyPair::from_pkcs8(
            untrusted::Input::from(&pkcs8_bytes),
        ).chain_err(|| "not a valid Ed25519 keypair")?;
        Ok(KeyPair {
            algorithm: SignatureAlg::Ed25519,
            keypair: keypair,
        })
    }
pub fn unseal ( signature_alg : SignatureAlg , encryption_alg : EncryptionAlg , sealing_key : & [ u8 ] , sealed_keypair : & [ u8 ] , ) -> Result < KeyPair > { // Ed25519 is the only signature algorithm we presently support assert_eq ! ( signature_alg SignatureAlg Ed25519 ) ; let pkcs8_bytes = crypto :: symmetric :: unseal ( encryption_alg , sealing_key , sealed_keypair ) ? ; let keypair = ring :: signature :: Ed25519KeyPair :: from_pkcs8 ( untrusted :: Input :: from ( & pkcs8_bytes ) , ) . chain_err ( | | " " ) ? ; Ok ( KeyPair { algorithm : SignatureAlg :: Ed25519 , keypair : keypair , } ) }
Unseal an encrypted `KeyPair`
Unseal an encrypted ` KeyPair `
signature_alg
SignatureAlg
encryption_alg
EncryptionAlg
sealing_key
&[u8]
sealed_keypair
&[u8]
signature_alg
SignatureAlg
encryption_alg
EncryptionAlg
sealing_key
&[u8]
sealed_keypair
&[u8]