fn deserialize_ed25519_keypair<'de, D>(deserializer: D) -> Result<Ed25519, D::Error>
where
    D: de::Deserializer<'de>,
{
    use de::Error;
    let string = Zeroizing::new(String::deserialize(deserializer)?);
    let mut keypair_bytes = Zeroizing::new([0u8; ED25519_KEYPAIR_SIZE]);
    let decoded_len = Base64::default()
        .decode_to_slice(string.as_bytes(), &mut *keypair_bytes)
        .map_err(D::Error::custom)?;

    if decoded_len != ED25519_KEYPAIR_SIZE {
        return Err(D::Error::custom("invalid Ed25519 keypair size"));
    }

    Ed25519::from_bytes(&*keypair_bytes).map_err(D::Error::custom)
}
/// Deserialize an Ed25519 keypair from Base64
Deserialize an Ed25519 keypair from Base64
Deserialize an Ed25519 keypair from Base64
fn deserialize_ed25519_keypair<'de, D>(deserializer: D) -> Result<Ed25519, D::Error>
where
    D: de::Deserializer<'de>,
{
    use de::Error;
    let string = Zeroizing::new(String::deserialize(deserializer)?);
    let mut keypair_bytes = Zeroizing::new([0u8; ED25519_KEYPAIR_SIZE]);
    let decoded_len = Base64::default()
        .decode_to_slice(string.as_bytes(), &mut *keypair_bytes)
        .map_err(D::Error::custom)?;
    if decoded_len != ED25519_KEYPAIR_SIZE {
        return Err(D::Error::custom("invalid Ed25519 keypair size"));
    }
    Ed25519::from_bytes(&*keypair_bytes).map_err(D::Error::custom)
}
fn deserialize_ed25519_keypair < ' de , D > ( deserializer : D ) -> Result < Ed25519 , D :: Error > where D : de :: Deserializer < ' de > , { use de :: Error ; let string = Zeroizing :: new ( String :: deserialize ( deserializer ) ? ) ; let mut keypair_bytes = Zeroizing :: new ( [ 0u8 ; ED25519_KEYPAIR_SIZE ] ) ; let decoded_len = Base64 :: default ( ) . decode_to_slice ( string . as_bytes ( ) , & mut * keypair_bytes ) . map_err ( D :: Error :: custom ) ? ; if decoded_len != ED25519_KEYPAIR_SIZE { return Err ( D :: Error :: custom ( " " ) ) ; } Ed25519 :: from_bytes ( & * keypair_bytes ) . map_err ( D :: Error :: custom ) }
Deserialize an Ed25519 keypair from Base64
Deserialize an Ed25519 keypair from Base64
deserializer
D