Struct pbp::PgpKey [] [src]

pub struct PgpKey { /* fields omitted */ }

An OpenPGP formatted ed25519 public key.

This allows you to transmit an ed25519 key as a PGP key. Though gpg and other implementations will probably be willing to import this public key, it is not designed for use within the PGP ecosystem, but rather to transfer public key data through mediums in which an OpenPGP formatted key is expected.

This type implements Display by ASCII armoring the public key data.

Methods

impl PgpKey
[src]

[src]

Construct a PgpKey from an ed25519 public key.

This will construct a valid OpenPGP Public Key datagram with the following packets:

  • A public key packet (formatted according to the "EdDSA for OpenPGP" extension draft)
  • A user id (whatever string you pass as the user id argument)
  • A self-signature, with key usage flags all set to null

The sign function must be a valid function for signing data with the private key paired with the public key. You are required to provide this so that you don't have to trust this library with direct access to the private key.

A PgpKey constructed this way is likely to be importable to gpg, though the private key associated with it has been given no privileges to sign or encrypt data.

Warnings

This will panic if your key is not 32 bits of data. It will not otherwise verify that your key is a valid ed25519 key.

[src]

The ed25519 public key data contained in this key.

[src]

Construct a PgpKey struct from an OpenPGP public key.

This does minimal verification of the data received. it ensures that the initial portion of the data is an OpenPGP public key packet, formatted to contain an ed25519 public key. It does not ensure that the actual public key is a valid ed25519 key, and no verification is done on the remainder of the data.

As a result, a key constructed this way many not successfully import into an OpenPGP implementation like gpg.

[src]

The OpenPGP fingerprint of this public key.

Trait Implementations

impl Display for PgpKey
[src]

[src]

Formats the value using the given formatter. Read more