Replies: 5 comments
-
What's your use case for having multiple keys in a single PKCS#12 file? What API do you propose for parsing such files? |
Beta Was this translation helpful? Give feedback.
-
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 (we have mTLS). During the deployment of our application, we are meant to read, generate and spread out required keystores; Proposition:
Here's an example of the func:
|
Beta Was this translation helpful? Give feedback.
-
I'm concerned that this API is too difficult to use correctly. Presumably, the desired end state for this use case is to get a I'd prefer an API like the following, which automatically matches certificates to private keys: type Chain struct {
FriendlyName string
PrivateKey crypto.PrivateKey
Leaf *x509.Certificate
CACerts []*x509.Certificate
}
func DecodeChains(pfxData []byte, password string) ([]Chain, error) For every private key, it would find the corresponding certificate for that key, and then build a chain by recursively finding the issuer certificate. This would resolve #54 but not #49; however I'm not sure that detailed inspection of PKCS#12 files is a use case worth supporting. |
Beta Was this translation helpful? Give feedback.
-
I see, I understand your concerns. The API you offer works in my use case perfectly. I'd like to work on a PR if this proposition gets accepted. |
Beta Was this translation helpful? Give feedback.
-
Linked #62 |
Beta Was this translation helpful? Give feedback.
-
Hello folks.
Discussion topic: why does pfxData in DecodeChain support only one key bag?
Having multiple key bags is a crucial feature for me personally. Extending pfxData and DecodeChain to be able to support multiple key bags shouldn't be too hard. What do you think?
Beta Was this translation helpful? Give feedback.
All reactions