Expand description
OpenPGP (RFC 9580) for mail, with Sequoia and its pure-Rust cryptography.
- Your keys live in
~/.local/share/sioul/pgp/own/. A key made here keeps its revocation certificate beside it,<fingerprint>.rev, yours alone as the key is (revocation_path); revoking is not built. A key’s private part is in one of two places (Place): here, encrypted with a passphrase the system keyring keeps (sioul-syncasks it), so nothing is asked at each message; or on a security key, which signs and opens itself after its PIN (crate::securitykey), Sioul keeping only its public certificate. Keys come from an import (a file, GnuPG’s export), are made here, or are a security key’s. - Others’ keys live in
…/pgp/others/: imported, found in their messages (Autocrypt), or looked up on request. - Signing and opening take Sequoia’s own
SignerandDecryptortraits: a key here or a security key, the same way. A message a security key opened keeps its session key in memory (SessionKeys), so that it opens again without the key until Sioul closes. - What this module does not do: talk to the network, or to the keyring. Passphrases and PINs come in as arguments.
Structs§
- Checked
- A signature, checked.
- Helper 🔒
- KeySummary
- A key as the window lists it.
- Keys
- The keys Sioul knows: yours (their secret parts here, or on a security key), others’, and your security keys.
- Lent 🔒
- A signer lent for one message: Sequoia’s stream takes its signer by value, and a security key’s signer borrows what it needs to reach the key.
- Opened
- What opening a message found.
- Own
- Your key for an address: its certificate, and where its private part is.
- PgpView
- What a protected message showed when opened, for the reader’s line.
- Session
Keys - The session keys of messages a security key opened, by message: such a message opens again, with its attachments and its answer, without the key, until Sioul closes. In memory only, never on disk.
- Unlock
- How your keys open what is encrypted to you.
Enums§
- Fingerprint
- A key’s fingerprint, as the crates that do not use Sequoia themselves name it. A long identifier for certificates and keys.
- Place
- Where the private part of one of your keys is.
Constants§
- LARGEST_
DECRYPTED 🔒 - The most a decrypted message may hold: anyone can encrypt to your key, and a few kilobytes of compressed data can inflate to gigabytes.
Functions§
- autocrypt_
header - The Autocrypt header for your outgoing mail: your key, smallest form (primary, encryption subkey, the user ID with your address).
- autocrypt_
key - Autocrypt (Level 1, §2.1): the key a message’s header carries for its sender.
- can_
sign_ 🔒with - Whether the key
fingerprintofcertcan sign now: valid, alive, not revoked, allowed to sign. - canonical 🔒
- Lone LF become CRLF: what was signed is the canonical form (RFC 3156 §5).
- certificates_
in - The certificates of
bytes(armored or binary), read, not kept. - decrypt
- Decrypts an OpenPGP message (armored or not) with your keys, checking the
signatures inside.
unlockgives the passphrase of a key of yours here, the session keys kept, and your security key when you asked to use it. - encrypt
dataencrypted to the recipients’ keys, signed by yours when given; armored.- export_
public - A key’s public part, armored, to give to others.
- generate
- Makes a key for you: Curve25519, for signing and encrypting, valid three
years; its secret parts encrypted with
passphrase. Its revocation certificate, which Sequoia makes with it, is kept beside it (revocation_path): the only way to revoke the key once it is lost. - generate_
at 🔒 generateinto the folderroot(pgp/).- here_
signer - Your key here that signs, its secret part opened with
passphrase: the signer of a key kept on this device. - import
- Imports the keys of a file: armored or binary, public or secret.
- keep_
card_ certificate - Keeps the certificate of your security key with your keys: public parts only.
- key_of
- The key
fingerprintofcert, its public part, primary or subkey. - kind_of 🔒
- learn
- Keeps keys found for
address: public parts only, and only those naming it. - learn_
autocrypt - Keeps a key from an Autocrypt header: only public parts, only when it names its sender.
- message_
id 🔒 - A message’s name among the session keys: SHA-256 of its encrypted bytes.
- names 🔒
- Whether a key holds
addressamong its user IDs. - new_
passphrase - A long random passphrase for a key made here: nobody types it, the keyring keeps it.
- open
- Opens a protected message: PGP/MIME encrypted or signed (RFC 3156), or
inline PGP. Gives back the message as it reads once decrypted (its own
headers, then what was inside), when it was encrypted, and what was found;
None when nothing is protected. A message encrypted to your security key
opens only when
unlockcarries it, or from a session key kept; otherwise its view names the key it waits for. - opens
- Whether
passphraseopens the secret parts of your keyfingerprint. - others_
dir 🔒 - outer_
headers 🔒 - The message’s own header lines but its MIME ones, which the decrypted body brings.
- own_dir 🔒
- pgp_dir 🔒
- policy 🔒
- read_
certs 🔒 - remove
- Removes a key; yours are kept aside in
pgp/removed, never deleted, with their revocation certificate. - revocation_
path - Where the revocation certificate of your key made here is kept: beside
the key,
pgp/own/<fingerprint>.rev, readable by you alone (write_key), as GnuPG keeps its own inopenpgp-revocs.d. - revocation_
text 🔒 - A revocation certificate as a file to keep: what it is, in a few lines, then the signature armored, a colon before its first line so that it cannot be imported by mistake (as GnuPG writes its own).
- save_
revocation - Copies the revocation certificate of your key
fingerprintintofolder, as<fingerprint>.rev(a number added when that name is taken), yours alone; none kept for that key, an error. - save_
revocation_ 🔒at save_revocationfrom the folderroot(pgp/).- sign_
detached - A detached signature of
data, armored, and the hash it used (“pgp-sha512”), for multipart/signed (RFC 3156 §5).signeris your key here (here_signer) or on a security key (securitykey::CardSigner). - store 🔒
- Keeps a key, merged with what was known of it. Secret parts go with yours, and so does the certificate of a security key of yours, whatever brings it again (an Autocrypt header, a lookup).
- store_
at 🔒 storeinto the folderroot(pgp/).- store_
in 🔒 - summaries
- Every key, yours first; a security key’s certificate names its key.
- summary 🔒
- verify_
detached - Checks a detached signature of
data(multipart/signed). - wkd_
urls - Where a domain’s Web Key Directory keeps the key of
address: the advanced address, then the direct one (draft-koch-openpgp-webkey-service §3.1). - write_
key 🔒 - Writes a key file beside, then moves it in place. On Unix it is readable by you alone, whatever the umask: your secret keys, and whose keys you keep.
- zbase32 🔒
- z-base-32 (RFC 6189 §5.1.6), as WKD names keys.
Type Aliases§
- Signing
- A signer of yours, as Sequoia takes it: a key here (
here_signer) or on a security key (securitykey::CardSigner).