-
Notifications
You must be signed in to change notification settings - Fork 89
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
Implement DecodeChains function that accepts multiple key bags #62
Comments
After taking a look at the code, I have some stuff to discuss.
|
We can't use func issuedBy(subject, issuer *x509.Certificate) bool {
return bytes.Equal(subject.RawIssuer, issuer.RawSubject) && issuer.CheckSignature(subject.SignatureAlgorithm, subject.RawTBSCertificate, subject.Signature) == nil
} If more than one certificate matches, we should probably add them both to It's an open question whether friendly names should match when picking certificates. This doesn't seem to be specified anywhere, and we've got several examples of PKCS#12 files where the friendly names do not match. |
So the Indeed, in "Windows Azure Tools" test data private key matches the certificate but friendly names do not match (and for some certificates, e.g. created and imported via |
Yeah, I think this is the best option. |
feature/decodechains: resolve SSLMate#62
I'm working on another implementation, depending on this great go-pkcs2 lib About the proposed #63 PR ... may I share my concerns (me using the library) and kindly asking for your perspective? I did prepare an example key chain using Keystore Explorer tool (see image below) Using the code from the #63 PR, I implemented some simple tests (shown below). Screenshot, example signed certificate chainsGo test code, demoing
|
Discussed in #61
According to the PKCS#12 v1.1. standard, a PKCS#12 file may have multiple key bags.
Use case: an application uses a PKCS#12 keystore to connect to two other apps in the cluster, one asks for one key, another for another (there is mTLS). During the deployment of an application, keystores are meant to be read and generated.
API proposal (by @AGWA):
Details:
FriendlyName
attribute is extracted from attributes of each bag viaconvertAttributes
FriendlyName
s should match; build a chain viax509.Certificate.Verify(opts)
perhaps?This resolves #54, and the use case of #49.
The text was updated successfully, but these errors were encountered: