Std.Crypto.Sign
Std.Crypto.Sign — Ed25519 digital signatures (RFC 8032).
Types
type SecretKey
type PublicKey
Values
generate : Task Error SecretKey
A fresh random key pair, as its secret key (`publicKey` derives the other
publicKey : SecretKey -> PublicKey
The public key of a secret key.
publicKeyFromBase64 : String -> Result Error PublicKey
Load a public key from standard base64.
publicKeyFromBytes : String -> Result Error PublicKey
Load a public key from its 32 bytes. `Err` on a wrong length or bytes
publicKeyToBase64 : PublicKey -> String
The standard base64 of a public key.
publicKeyToBytes : PublicKey -> String
The 32 bytes of a public key.
secretKeyFromBase64 : Secret -> Result Error SecretKey
Load a secret key from the standard base64 of its 32-byte seed — the
secretKeyFromBytes : Secret -> Result Error SecretKey
Load a secret key from its 32-byte seed (RFC 8032's "secret key").
secretKeyToBase64 : SecretKey -> Secret
The standard base64 of the 32-byte seed, still wrapped in a `Secret`.
secretKeyToBytes : SecretKey -> Secret
The 32-byte seed of a secret key, still wrapped in a `Secret`.
sign : SecretKey -> String -> String
`sign key message` — the 64-byte Ed25519 signature of `message`.
verify : PublicKey -> String -> String -> Bool
`verify publicKey message signature` — `True` only when `signature` is