Skip to content
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

Initial code to sign keyinfo #464

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

cjbarth
Copy link
Contributor

@cjbarth cjbarth commented Apr 11, 2024

This is to provide a helper function to sign all children of the root node and a way to include keyinfo in the signature.

Closes: #463

@sibelius
Copy link

any plans to merge this?

@cjbarth
Copy link
Contributor Author

cjbarth commented Jan 31, 2025

@sibelius , yes, there are plans to merge this once it is done. Please feel free to contribute; I can use all the help I can get as recently I don't have much time for development on this project.

@@ -901,7 +937,14 @@ export class SignedXml {

const keyInfoContent = this.getKeyInfoContent({ publicCert: this.publicCert, prefix });
if (keyInfoAttrs || keyInfoContent) {
return `<${currentPrefix}KeyInfo${keyInfoAttrs}>${keyInfoContent}</${currentPrefix}KeyInfo>`;
const keyInfoXml = `<${currentPrefix}KeyInfo${keyInfoAttrs}>${keyInfoContent}<fake>2</fake></${currentPrefix}KeyInfo>`;

Choose a reason for hiding this comment

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

fake is correct ?

or just testing ?

@sibelius
Copy link

should we remove whitespace before signing ?

@sibelius
Copy link

sibelius commented Jan 31, 2025

I'm checking the output from this reference implementation that works https://github.com/bacen/pix-dict-quickstart/blob/master/src/main/java/br/gov/bcb/pi/dict/xml/XMLSigner.java#L63

and the output of this package

xml-crypto does not keep the \n inside ds:SignatureValue

here is a print with the signature with \n
image

should I implement or active this somehow ?

I think this broke in your pull request, in main is working well

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.

[ENHANCEMENT]: Improve experience of adding a Reference to the Signature.
2 participants