Skip to content

Comments

Refactor keys package#794

Merged
RJPercival merged 3 commits intogoogle:masterfrom
RJPercival:key_subpkgs
Aug 14, 2017
Merged

Refactor keys package#794
RJPercival merged 3 commits intogoogle:masterfrom
RJPercival:key_subpkgs

Conversation

@RJPercival
Copy link
Contributor

In the future, this will make it easier to exclude support for particular key types from the build through the use of build tags. For example, PKCS#11 key support currently requires a C module that causes problems for some users - this could be excluded from the build by default, so that only those people that want it need to install the dependency.

@gdbelvin
Copy link
Contributor

Please rebase and then ping me

Rob Percival added 3 commits August 14, 2017 13:29
This will make it easier to exclude key types from the build through the
use of build tags in the future. For example, PKCS#11 key support could be
excluded from the build unless a build tag is used, e.g.
`go build -t pkcs11`. A key benefit is that this would avoid forcing users
to install dependencies for all key types - only those that they include
in their build.
Required putting some of the tests in a different package to the package
under test, and then using "import ." (see
https://github.com/golang/go/wiki/CodeReviewComments#import-dot), so as
to avoid import cycles.
- pem.NewFromPrivatePEMFile to pem.ReadPrivateKeyFile
- pem.NewFromPrivatePEM to pem.UnmarshalPrivateKey
- pem.NewFromPublicPEMFile to pem.ReadPublicKeyFile
- pem.NewFromPublicPEM to pem.UnmarshalPublicKey
- pem.NewFromPEMKeyFileProto to pem.FromProto
- der.NewFromPrivateDER to der.UnmarshalPrivateKey
- der.NewFromPublicDER to der.UnmarshalPublicKey
- der.NewFromPrivateKeyProto to der.FromProto

More consistent with other packages, e.g. crypto/x509, protobuf.
@RJPercival
Copy link
Contributor Author

Rebased - PTAL.

@RJPercival
Copy link
Contributor Author

Travis will never be happy, as this breaks certificate-transparency-go. PR google/certificate-transparency-go#58 fixes it.

@RJPercival RJPercival requested a review from codingllama August 14, 2017 16:03
@RJPercival RJPercival merged commit a62a74d into google:master Aug 14, 2017
RJPercival pushed a commit to RJPercival/certificate-transparency-go that referenced this pull request Aug 14, 2017
RJPercival pushed a commit to RJPercival/certificate-transparency-go that referenced this pull request Aug 14, 2017
RJPercival pushed a commit to google/certificate-transparency-go that referenced this pull request Aug 15, 2017
@RJPercival RJPercival deleted the key_subpkgs branch August 15, 2017 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants