Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Generate a brazilian NFe signature standard node. #141

@cmjunior

Description

@cmjunior

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions