go-piv / piv-go

Keys and certificates for YubiKeys, written in Go
Apache License 2.0
366 stars 65 forks source link

Add generic Smartcard API #141

Closed spilikin closed 8 months ago

spilikin commented 8 months ago

Hi,

we would like to use your great project to communicate with german healthcare smartcards (insurant, practitioner, institution). Therefore it would be great to have a generic Smartcard struct with some basic APDU API.

Later on we can contribute more features, like APDU-Builder, MF/EF Files, Certificates etc, if you like.

Thank you

ericchiang commented 8 months ago

Hey, thanks the PR.

piv-go is well scoped and I don't see it expanding to target general smart card APIs or other applets. Even existing features like windows support is tricky given I don't have test hardware.

The best course is probably to fork or copy the relevant logic.

spilikin commented 8 months ago

Thanx for fast reply. We'll check what you license allows and decide how to proceed.

Thanks again for great code!

areese commented 8 months ago

@spilikin I would love to separate out the apdu interface from the piv-go code. I added pgp support in a fork, and was considering doing exactly this to make the pgp support cleaner. My fork is here: https://github.com/areese/piv-go

ericchiang commented 8 months ago

Thanks for understanding! GitHub provides some summaries of licenses, and what they allow: https://choosealicense.com/licenses/apache-2.0/ (obviously, this is not legal advice)

Given that Apache 2.0 is one of the most popular licenses on GitHub, I'd be surprised if it doesn't work for your use cases, though there is some forked code from the Go repository here: https://github.com/go-piv/piv-go/blob/master/third_party/rsa/LICENSE

Going to close out for now