-
Notifications
You must be signed in to change notification settings - Fork 175
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
Allow FileKeyInfo to accept a string for the cert #243
Comments
I also note that the parameter |
Finally, in this same area of code, it doesn't seem that there is support for multiple certs as seems is supported by SAML. Is that something that could be added? |
Here is another reference to the spec: https://www.w3.org/TR/xmldsig-core1/#sec-X509Data. |
@cjbarth - FileKeyInfo is a convenience implementation of a KeyInfoProvider interface, which exposes just two methods, Is there any reason why you don't wish to maintain your own implementation of KeyInfoProvider? |
There are at least two reasons:
|
In that case, our suggested changes might need to focus on how to make |
@LoneRifle As I look over the tests for this project more thoroughly, I see that there are no tests that exercise
Given the above, my question above still stands. Even if we decide to implement this function as a |
@cjbarth - I unfortunately inherited the codebase with this already in place. Unsure of the original author's intent here (perhaps it's just a stub?), especially since the codebase that uses this at work is not dependent on this and is migrating to OIDC. I'm happy for you to decide what the behaviour should be! |
@ganesha289, care to comment on this? |
I had to reverse engineer a few things to figure out how to even use KeyInfoProvider, and from context. I actually explain it "abstractly" in the JSDocs I added in my PR, but the gist of what I think those are supposed to do is encapsulate the relationship that "Security//Signature//KeyInfo" element has to the "Security//BinarySecurityToken" element. Yaron seems to have intended to provide an interface that allowed exotic implementations while providing an implementation that could do one thing and do it well. It's useful to understand this objective by separating the abstraction (KeyInfoProvider) and its implementation (FileKeyInfo): The abstraction (KeyInfoProvider) enables two use cases: The implementation (FileKeyInfo) accomplishes three things: The only real question would be: is there actually a schema-compatible use-case for the abstraction? **EDIT: in my examples, I refer to the WS-Security strongly recommended
or
@ganesha289 @LoneRifle @cjbarth I hope this sheds some light on how these pieces seem to work together |
I think this can probably be closed now that @djaqua code has been merged. I think the next step is to get it in |
Agreed. Fixed by #273. |
Currently
FileKeyInfo
only accepts a file path for construction. The means that the cert must be on a file system somewhere. In our security context, the certs and keys aren't on disk, they are in memory, so ideally we'd like to constructFileKeyInfo
using a string that is the cert, not a path.Would you be open to a PR that changed this code to accept a string that is either a file path or a cert? The basic switch would be that if the string isn't a valid path, then treat the string as if it were a cert and proceed as normal.
The text was updated successfully, but these errors were encountered: