/// Compute the key identifier for a forward secure encryption public key
Compute the key identifier for a forward secure encryption public key
Compute the key identifier for a forward secure encryption public key
pub fn forward_secure_key_id(public_key: &CspFsEncryptionPublicKey) -> KeyId {
    let mut hash = Sha256::new_with_context(&DomainSeparationContext::new(
        "KeyId from CspFsEncryptionPublicKey",
    ));
    let variant: &'static str = public_key.into();
    hash.write(DomainSeparationContext::new(variant).as_bytes());
    match public_key {
        CspFsEncryptionPublicKey::Groth20_Bls12_381(public_key) => {
            hash.write(public_key.as_bytes())
        }
    }
    KeyId::from(hash.finish())
}
pub fn forward_secure_key_id ( public_key : & CspFsEncryptionPublicKey ) -> KeyId { let mut hash = Sha256 :: new_with_context ( & DomainSeparationContext :: new ( " " , ) ) ; let variant : & ' static str = public_key . into ( ) ; hash . write ( DomainSeparationContext :: new ( variant ) . as_bytes ( ) ) ; match public_key { CspFsEncryptionPublicKey :: Groth20_Bls12_381 ( public_key ) => { hash . write ( public_key . as_bytes ( ) ) } } KeyId :: from ( hash . finish ( ) ) }
Compute the key identifier for a forward secure encryption public key
Compute the key identifier for a forward secure encryption public key
public_key
&CspFsEncryptionPublicKey