square / certstrap

Tools to bootstrap CAs, certificate requests, and signed certificates.
Apache License 2.0
2.31k stars 207 forks source link

Add support for ECC to the pkix package #130

Closed jdtw closed 2 years ago

jdtw commented 2 years ago

This PR adds support for creating, importing, and exporting ECDSA/Ed25519 keys to the pkix package. Commandline options will be added to certstrap to expose this functionality in a followup PR[1].

Since the standard library doesn't support encrypted PKCS8[2], we take a dependency on the pemutil[3] package to do this encryption/decryption for us.

All RSA operations continue to use PKCS1 for backwards compatibility.

[1] WIP at https://github.com/square/certstrap/pull/128 [2] https://github.com/golang/go/issues/8860#issuecomment-66099274 [3] https://pkg.go.dev/go.step.sm/crypto/pemutil