Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pgp-wrapper example #68

Merged
merged 1 commit into from
May 13, 2024
Merged

Add pgp-wrapper example #68

merged 1 commit into from
May 13, 2024

Conversation

wiktor-k
Copy link
Owner

Creates an OpenPGP certificate based on the SSH key and allows signing files emitting OpenPGP framed packets.

Requires that the first key in SSH is ed25519 (see ssh-add -L).

Generate a key with:
cargo run --example pgp-wrapper generate "John Doe <[email protected]>" > key.pgp

Sign data using:
cargo run --example pgp-wrapper sign < Cargo.toml > Cargo.toml.sig

Import the certificate using GnuPG:

$ gpg --import key.pgp
gpg: key A142E92C91BE3AD5: public key "John Doe <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1

Verify the signature using GnuPG:

$ gpg --verify Cargo.toml.sig
gpg: assuming signed data in 'Cargo.toml'
gpg: Signature made Fri May 10 11:15:53 2024 CEST
gpg:                using EDDSA key 4EB27E153DDC454364B36B59A142E92C91BE3AD5
gpg: Good signature from "John Doe <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 4EB2 7E15 3DDC 4543 64B3  6B59 A142 E92C 91BE 3AD5

Works perfectly in conjunction with openpgp-card-agent.rs!

@wiktor-k wiktor-k force-pushed the wiktor/pgp-wrapper branch from d9756ed to 8d6ff16 Compare May 10, 2024 09:27
Creates an OpenPGP certificate based on the SSH key and allows signing files
emitting OpenPGP framed packets.

Requires that the first key in SSH is ed25519 (see `ssh-add -L`).

Generate a key with:
`cargo run --example pgp-wrapper generate "John Doe <[email protected]>" > key.pgp`

Sign data using:
`cargo run --example pgp-wrapper sign < Cargo.toml > Cargo.toml.sig`

Import the certificate using GnuPG:
```sh
$ gpg --import key.pgp
gpg: key A142E92C91BE3AD5: public key "John Doe <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
```

Verify the signature using GnuPG:
```sh
$ gpg --verify Cargo.toml.sig
gpg: assuming signed data in 'Cargo.toml'
gpg: Signature made Fri May 10 11:15:53 2024 CEST
gpg:                using EDDSA key 4EB27E153DDC454364B36B59A142E92C91BE3AD5
gpg: Good signature from "John Doe <[email protected]>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 4EB2 7E15 3DDC 4543 64B3  6B59 A142 E92C 91BE 3AD5
```

Works perfectly in conjunction with `openpgp-card-agent.rs`!

Signed-off-by: Wiktor Kwapisiewicz <[email protected]>
@wiktor-k wiktor-k force-pushed the wiktor/pgp-wrapper branch from 8d6ff16 to 6981c15 Compare May 13, 2024 11:00
@wiktor-k wiktor-k enabled auto-merge May 13, 2024 11:00
@wiktor-k wiktor-k merged commit 73fcf48 into main May 13, 2024
16 checks passed
@wiktor-k wiktor-k deleted the wiktor/pgp-wrapper branch May 13, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant