Skip to main content

add_key_from_bytes

Function add_key_from_bytes 

Source
pub fn add_key_from_bytes(
    key_bytes: &[u8],
    name: &str,
    quiet: bool,
) -> Result<(), Error>
Expand description

Adds a PGP key from a byte slice to the local keyring.

The key is saved as <name>.asc in the PGP directory. If a key with the same name exists but has different content, it will be overwritten (with a warning if quiet is false).

ยงErrors

Returns an error if the PGP directory cannot be accessed, or if the key is invalid.