#[non_exhaustive]pub enum GhostkeyRequest {
Show 20 variants
ImportGhostKey {
certificate_pem: String,
signing_key_pem: String,
master_verifying_key_pem: Option<String>,
},
ListGhostKeys,
GetGhostKey {
fingerprint: String,
},
GetCertificate {
fingerprint: String,
},
DeleteGhostKey {
fingerprint: String,
},
SetLabel {
fingerprint: String,
label: String,
},
SignMessage {
fingerprint: String,
message: Vec<u8>,
},
SignWithDefault {
message: Vec<u8>,
},
SetDefaultKey {
fingerprint: String,
},
GetDefaultKey,
VerifySignedMessage {
signed_message: Vec<u8>,
},
ExportGhostKey {
fingerprint: String,
},
ExportAllGhostKeys,
GrantPermission {
fingerprint: String,
requestor: SignatureRequestor,
},
RevokePermission {
fingerprint: String,
requestor: SignatureRequestor,
},
ListPermissions {
fingerprint: String,
},
TestPermissionPrompt {
fingerprint: String,
},
RequestAnyAccess,
HasIdentity,
MarkBackedUp {
fingerprint: String,
},
}Expand description
Requests from UI or other delegates to the ghostkey delegate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ImportGhostKey
Import a ghostkey from PEM-armored certificate and signing key. If master_verifying_key_pem is None, uses the hardcoded Freenet master key.
ListGhostKeys
List all stored ghostkeys.
GetGhostKey
Get details for a specific ghostkey.
GetCertificate
Get just the public certificate (for sharing with counterparties).
DeleteGhostKey
Delete a stored ghostkey.
SetLabel
Set a user-friendly label.
SignMessage
Sign a message with a specific ghostkey. The delegate scopes the signature to the requestor.
SignWithDefault
Sign a message with the user’s default ghostkey (highest-tier key, or user-overridden via SetDefaultKey). Apps should prefer this over SignMessage – it avoids needing to know about specific fingerprints.
SetDefaultKey
Set which ghostkey is the default for signing.
GetDefaultKey
Get the current default ghostkey fingerprint.
Returns DefaultKeyResult { fingerprint: None } when the caller has no
Sign grant on any key, which is NOT the same as the user having no
ghostkey – use HasIdentity for that question. This request never
prompts: it is a question, and an app must not be able to put a dialog
in front of the user just by asking one. SignWithDefault is the one
that prompts, because it acts.
VerifySignedMessage
Verify a signed message produced by this delegate.
ExportGhostKey
Export a ghostkey’s certificate and signing key for backup. Security-sensitive: returns the private signing key.
ExportAllGhostKeys
Export all ghostkeys for backup.
GrantPermission
Grant an application or delegate permission to use a ghostkey.
RevokePermission
Revoke a previously granted permission.
ListPermissions
List permissions for a ghostkey.
TestPermissionPrompt
Debug: force a permission prompt regardless of existing permissions.
RequestAnyAccess
A third-party app asks for any one of the user’s ghostkeys. The
delegate emits a user prompt that lets the user pick a key (or
deny). On approval the delegate grants {ReadPublic, Sign} to
the requesting app for the chosen fingerprint and replies with a
single-element GhostKeyList containing that key.
The request takes no fields on purpose: the only identifier the user sees in the prompt is the runtime-attested requestor (a truncated contract id). Letting the app supply free text would open a phishing surface (a hostile app could write text designed to look like Freenet UI chrome). Apps that want to communicate purpose to the user should do so in their own UI before this flow runs.
HasIdentity
Ask whether the user holds any ghostkey at all, WITHOUT prompting.
Apps need this and today have no way to get it. RequestAnyAccess
always prompts, so it cannot be polled. ListGhostKeys is filtered by
permission, so an app with no grant yet sees an empty list and cannot
tell “the user has none” from “I have not been granted access”.
The motivating case is the purchase round trip: an app that sends a user off to buy a ghostkey wants to notice when they come back, and polling a prompt is not an option.
What this discloses without consent is a count. That is more than the
bare existence bit NoIdentityAvailable already leaks to anyone who
asks for a signature, and the trade is deliberate: no fingerprints,
labels or tiers are exposed, a count cannot be correlated across users,
and the alternative is that the vault cannot tell a half-lost identity
from a healthy one.
MarkBackedUp
Record that the user has exported this identity, so the vault can stop
warning that it is the only copy. Requires Export scope, so only the
vault can set it – a third-party app must not be able to silence a
warning about a key it does not hold a backup of.
Trait Implementations§
Source§impl Clone for GhostkeyRequest
impl Clone for GhostkeyRequest
Source§fn clone(&self) -> GhostkeyRequest
fn clone(&self) -> GhostkeyRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more