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 initial gpg support #140

Closed
wants to merge 9 commits into from
Closed

Conversation

areese
Copy link
Contributor

@areese areese commented Feb 20, 2024

This PR adds support to use a Yubikey for GPG encryption and decryption.

There are still some large changes to be made based on the feedback in #138 and #137.

Once those are resolved, this code will be updated to reflect those.

This is very useful to see what APDU's are being sent to a card.
This allows the card to be used in PIV mode, or in PGP mode.

The Yubico cards can store PGP private keys and use them to sign/encrypt/decrypt data.

These changes add support for the OpenPGP specification APDU apis for pgp support.
Update with documentation and links to the OpenPGP and NIST Standards.
Add the ability to get the OpenPGP attestation cert from the yubikey
Add clean target to Makefile
Comment on lines 7 to +11
go build ./...

.PHONY: clean
clean:
go clean ./...
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are in #139, and should be dropped from this PR in cleanup

Comment on lines 1 to -3
module github.com/go-piv/piv-go

go 1.16
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are in #139, and should be dropped from this PR in cleanup

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericchiang let me know how you feel about storing the pdf's with the code.
I can remove them if you would prefer, I found it easier to store them with the code.

Needs some cleanup and need to check on the whole pcsc interface
@ericchiang
Copy link
Collaborator

Thanks, but I'm going to preemptively say there's no way this package will ever support GPG/PGP. A large motivating factor for this project was leveraging more reasonable signing primitives on Yubikeys. See: https://blog.gtank.cc/modern-alternatives-to-pgp/. I defiantly do not want to carry any code for the PGP app, and that's beyond the scope of piv-go.

In the future, it may be better to reach out to a maintainer before sending a large PR like this?

Closing, since yeah... I don't see this as compatible with this project. You may want to fork if this is something you're looking to publish

@ericchiang ericchiang closed this Feb 20, 2024
@areese
Copy link
Contributor Author

areese commented Feb 20, 2024

That’s fine
The effort for me to maintain an open fork or to upstream everything is the same cost.

I’ll separate out all the parts that allow me to use pgp support without rewriting the entire library to talk to the cards.

piv-go has all of the apdu primitives.

My issue is key size, I have constraints that require a 4096 bit key that the cards only support via pgp.

@areese
Copy link
Contributor Author

areese commented Feb 20, 2024

I need 4096 bit hardware backed keys.

I use S/MIME for email, and something else for signing commits (except on GitHub because reasons)

@ericchiang
Copy link
Collaborator

Sure, I just want to make clear that "I defiantly do not want to carry any code for the PGP app" also applies to internal refactors for this kind of thing (I don't have unlimited review time for OSS). If you need to use or modify the smartcard code, please fork it

@areese
Copy link
Contributor Author

areese commented Feb 20, 2024

That’s perfectly reasonable.

I’ll make this into a fork.

I already have one

@areese areese deleted the add-initial-gpg-support branch March 4, 2024 19:21
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.

None yet

2 participants