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

Generate a brazilian NFe signature standard node. #141

Open
cmjunior opened this issue Jul 29, 2024 · 0 comments
Open

Generate a brazilian NFe signature standard node. #141

cmjunior opened this issue Jul 29, 2024 · 0 comments

Comments

@cmjunior
Copy link

cmjunior commented Jul 29, 2024

I am trying to sign a Brazilian NFe XML, using this library. I was able to implement the signing using Fortify to access a token certificate. However, the resulting is completely different from a valid NFe signature node. Below is an example of a valid NFe signature node:

<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
        <SignedInfo>
            <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
            <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
            <Reference URI="#NFe35231047960950089785550520001403941083215372">
                <Transforms>
                    <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                    <Transform Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
                </Transforms>
                <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                <DigestValue>Hs8SCmlHApai7Frfd6JUz6hdezU=</DigestValue>
            </Reference>
        </SignedInfo>
        <SignatureValue>DII...g==</SignatureValue>
        <KeyInfo>
            <X509Data>
                <X509Certificate>MIIH...jfN</X509Certificate>
            </X509Data>
        </KeyInfo>
    </Signature>

How can I generate a similar signature node? What should be my approach to achieve this?

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

No branches or pull requests

1 participant