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

PAdES compliant signatures #149

Closed
Maxteke opened this issue Nov 3, 2021 · 3 comments
Closed

PAdES compliant signatures #149

Maxteke opened this issue Nov 3, 2021 · 3 comments

Comments

@Maxteke
Copy link

Maxteke commented Nov 3, 2021

Hello,

I'm trying to make a pades signature with your library.

function sign(pdfName, p12Name, passphrase)
{
    let pdfBuffer = fs.readFileSync(__dirname + "/../ressources/" + pdfName);
    const p12Buffer = fs.readFileSync(__dirname + "/../ressources/" + p12Name);

    pdfBuffer = plainAddPlaceholder({
                pdfBuffer,
                signatureLength: p12Buffer.length,
                subFilter: SUBFILTER_ETSI_CADES_DETACHED,
            });
    
    try {
        const signedPdf = signer.sign(pdfBuffer, p12Buffer, {passphrase: passphrase});
        fs.writeFileSync(__dirname + "/../ressources/Signed_" + pdfName, signedPdf);
    } catch (e) {
        console.log(e.message);
    }
}

from this code the signature is invalid on dss platform:
Capture

I tried to put the subFilter option on plainAddPlaceholder but the sub filter stay adbe.pkcs7.detached
https://github.com/vbuch/node-signpdf#pades-compliant-signatures

@vbuch
Copy link
Owner

vbuch commented Nov 11, 2021

Ah. I never got that released. In the repo you are looking at the docs of develop. Npm has what's in master. So... either wait for me to get a release out or use the develop code.

@vbuch
Copy link
Owner

vbuch commented Nov 13, 2021

This is out with 1.4.1 https://github.com/vbuch/node-signpdf/releases/tag/v1.4.0
Closing here.

@vbuch vbuch closed this as completed Nov 13, 2021
@Maxteke
Copy link
Author

Maxteke commented Sep 6, 2022

Hi,

I retry with the latest version of your library.

The result change a little bit but stay invalid.
image
Thanks in advance for the help!

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

2 participants