/// Converts a secret key into a forward secure secret key set.
///
/// # Errors
/// This returns an error if the secret key is not forward secure.
Converts a secret key into a forward secure secret key set.
Converts a secret key into a forward secure secret key set .
pub fn fs_key_set(
        secret_key: CspSecretKey,
    ) -> Result<CspFsEncryptionKeySet, ni_dkg_errors::MalformedSecretKeyError> {
        if let CspSecretKey::FsEncryption(key_set) = secret_key {
            Ok(key_set)
        } else {
            let unexpected_type_name: &'static str = secret_key.into();
            Err(ni_dkg_errors::MalformedSecretKeyError {
                algorithm: AlgorithmId::Placeholder, // There is no on expected algorithm ID.
                internal_error: format!("Unexpected variant: {}", unexpected_type_name),
            })
        }
    }
pub fn fs_key_set ( secret_key : CspSecretKey , ) -> Result < CspFsEncryptionKeySet , ni_dkg_errors :: MalformedSecretKeyError > { if let CspSecretKey :: FsEncryption ( key_set ) = secret_key { Ok ( key_set ) } else { let unexpected_type_name : & ' static str = secret_key . into ( ) ; Err ( ni_dkg_errors :: MalformedSecretKeyError { algorithm : AlgorithmId :: Placeholder , // There is no on expected algorithm ID. internal_error : format ! ( " " unexpected_type_name ) , } ) } }
Converts a secret key into a forward secure secret key set.
Converts a secret key into a forward secure secret key set .
secret_key
CspSecretKey
errors
This returns an error if the secret key is not forward secure.
This returns an error if the secret key is not forward secure .