ralpha / pdf_signing

Rust library for adding signatures and digitally sign PDF documents.
Apache License 2.0
20 stars 8 forks source link

Signature user information is overridden by certificate information #3

Open SergenN opened 2 years ago

SergenN commented 2 years ago

When a document is signed by running the sign_doc.rs the information defined in the UserSignatureInfo struct is ignored by acrobat. Instead it takes user information from the certificate instead.

        UserSignatureInfo {
            user_id: "272".to_owned(),
            user_name: "Charlie".to_owned(),
            user_email: "charlie@test.com".to_owned(),
            user_signature: std::fs::read("./examples/assets/sig1.png").unwrap(),
            user_signing_keys: signer.clone(),
        }
Schermafbeelding 2022-08-10 om 13 48 18
ralpha commented 2 years ago

This is Acrobat that decides which info to show. I think when the name is missing from the Certificate it will use the name given in UserSignatureInfo. So try to create a new certificate without a username.

SergenN commented 2 years ago

Removing user information from the certificate does result in the correct data being displayed. I wonder if there is a way to override this behaviour as certain certificates are provided with the information pre-filled.

Schermafbeelding 2022-08-10 om 14 09 56