Skip to content

Conversation

@jdtw
Copy link
Contributor

@jdtw jdtw commented Nov 30, 2021

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 #128
[2] golang/go#8860 (comment)
[3] https://pkg.go.dev/go.step.sm/crypto/pemutil

@jdtw jdtw marked this pull request as ready for review December 1, 2021 19:48
}
signer = priv
case encryptedPKCS8PrivateKeyPEMBLockType:
b, err := pemutil.DecryptPKCS8PrivateKey(pemBlock.Bytes, password)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this something we need this 3p library for? (so nothing in stdlib or x/crypto that we can use?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately not, see this discussion: golang/go#8860 (comment)

That thread is where I found this package, which looks like it may get considered for inclusion into x/crypto.

@jdtw jdtw merged commit 6b3ab22 into master Dec 2, 2021
@jdtw jdtw deleted the jwood/ecc-primitives branch December 2, 2021 17:07
jdtw added a commit that referenced this pull request Dec 2, 2021
* master:
  Add support for ECC to the pkix package (#130)
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.

4 participants