Docs / Guides
Signatures
sign produces a composite ML-DSA-65 + Ed25519 signature. Verification passes only if both halves verify.
01How it works
The message is hashed with SHA-512 and prefixed with a fixed label and the signature header, then signed by both algorithms (RFC 10073 composite signatures). Stripping either half changes the length and fails verification.
02Sign and verify
const sig = sign.sign(signKeys, artifact);
const text = sign.toText(sig); // "pqlg.…"
sign.verify(publicSignKeys, artifact, text); // true, or throws PQLVerifyErrorsig = sign.sign(artifact, sign_keys)
text = sign.to_text(sig)
sign.verify(artifact, text, public_sign_keys) # None, or raises VerifyErrorsig, err := sign.Sign(signKeys, artifact)
text := sign.Encode(sig)
err = sign.VerifyText(publicSignKeys, artifact, text)03Signing releases
The CLI writes detached signatures that installers check before running anything:
pql keys new --purpose sign --out release.keyset --public-out release.pub
pql sign -k release.keyset -o app-1.2.0.tar.gz.pqlsig app-1.2.0.tar.gz
pql verify -k release.pub --sig app-1.2.0.tar.gz.pqlsig app-1.2.0.tar.gzThe uc4-release-signing use case shows a Node installer that refuses any artifact without a valid .pqlsig.
04Notes
- Signing is hedged: the engine mixes in fresh randomness, so two signatures of the same message differ. Both verify.
- A valid signature can be replayed. Include a version, timestamp or nonce in the signed message when replay matters.
- PQL-CNSA signs with ML-DSA-87 alone.
pqlock v0.1.0 · unaudited preview · source of truth: spec/