chloride.sign

Undocumented in source.

Members

Aliases

SignPrivateKey
alias SignPrivateKey = ubyte[crypto_sign_SECRETKEYBYTES]
Undocumented in source.
SignPublicKey
alias SignPublicKey = ubyte[crypto_sign_PUBLICKEYBYTES]
Undocumented in source.
SignatureLength
alias SignatureLength = crypto_sign_BYTES
Undocumented in source.
SigningSeed
alias SigningSeed = ubyte[crypto_sign_SEEDBYTES]
Undocumented in source.
makeSigningSeed
alias makeSigningSeed = randomArray!SigningSeed

Generate a seed that can be used to generate key pairs with makeSigningKeys.

Functions

makeSigningKeys
SigningKeys makeSigningKeys()

Generate a new random key pair suitable for public key signatures.

makeSigningKeys
SigningKeys makeSigningKeys(SigningSeed seed)

Generate a key pair from a seed.

messageSignature
ubyte[SignatureLength] messageSignature(ubyte[] message, SignPrivateKey key)

Compute a signature for a message using a private key. Unlike signMessage this does not include the original message.

openSignedMessage
ubyte[] openSignedMessage(ubyte[] signed, SignPublicKey key)

Verify a signed message using the public key corresponding to the private key used to sign it. If verification succeeds return the message (without the signature), otherwise return null.

signMessage
ubyte[] signMessage(ubyte[] message, SignPrivateKey key)

Sign a message using a private key by prepending a signature to the message.

verifySignature
bool verifySignature(ubyte[] message, ubyte[SignatureLength] signature, SignPublicKey key)

Verify a signed message using the public key corresponding to the private key used to sign it. Returns true on success and false on failure. This method is passed the message and signature separately.

Structs

SigningKeys
struct SigningKeys
Undocumented in source.

Meta