Skip to main content

MurkIdentity

Enum MurkIdentity 

Source
pub enum MurkIdentity {
    Age(Identity),
    Ssh {
        identity: Identity,
        pem: Zeroizing<String>,
    },
    Plugin {
        identity: Identity,
        pubkey: String,
    },
}
Expand description

An identity that can decrypt age-encrypted data.

Plugin identities (AGE-PLUGIN-<NAME>-1...) carry the recipient pubkey alongside the pointer so pubkey_string does not require spawning the plugin binary. Decryption spawns age-plugin-<name> via IdentityPluginV1 to access the hardware-backed key.

Variants§

§

Age(Identity)

§

Ssh

Fields

§identity: Identity
§pem: Zeroizing<String>

The original OpenSSH private-key text. age does not expose the SSH signing scalar, so we retain the PEM to derive an Ed25519 signing key for vault signing (ssh-ed25519 only). Zeroized on drop.

§

Plugin

Fields

§identity: Identity
§pubkey: String

Implementations§

Source§

impl MurkIdentity

Source

pub fn pubkey_string(&self) -> Result<String, CryptoError>

Return the public key string for this identity.

For age keys: age1.... For SSH keys: ssh-ed25519 AAAA... or ssh-rsa AAAA.... For plugin keys: the age1<plugin>1... recipient that was parsed from the identity file’s recipient header (# Recipient: or # public key:).

Source

pub fn plugin_name(&self) -> Option<&str>

Plugin name (e.g. "yubikey", "se") if this is a plugin identity.

Source

pub fn is_signing_capable(&self) -> bool

Whether this identity can produce vault signatures: native age keys, and ssh-ed25519 keys (which sign natively). ssh-rsa and hardware/plugin identities cannot. Cheap check for deciding whether to nudge on an unsigned vault; the actual key comes from Self::signing_key.

Source

pub fn registers_verifying_key(&self) -> bool

Whether this identity’s verifying key must be recorded in the signer registry (Meta::signers) for its signature to be verifiable.

Only age keys: their Ed25519 verifying key is derived from the secret and cannot be recovered from the public age recipient, so it must be published. ssh-ed25519 verifying keys are embedded in the recipient string itself, so they are self-authenticating and are NOT registered.

Source

pub fn signing_key(&self) -> Option<SigningKey>

This identity’s Ed25519 signing key, if it can sign.

  • Age keys: derived from the raw x25519 key bytes via a domain-separated KDF (see crate::signing), so it recovers from the BIP39 phrase.
  • ssh-ed25519 keys: the SSH key is an Ed25519 signing key; we parse it from the retained OpenSSH PEM (age does not expose the scalar). The resulting verifying key matches the ssh-ed25519 … recipient string.
  • ssh-rsa and plugin/hardware identities return None (unsigned).

Trait Implementations§

Source§

impl Clone for MurkIdentity

Source§

fn clone(&self) -> MurkIdentity

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MurkIdentity

Debug prints only the identity kind, never key material, to keep accidental logs from leaking secrets.

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V