Giter Site home page Giter Site logo

setasign / setapdf-signer-addon-globaltrust-trust2go Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 448 KB

A signature add-on for the SetaPDF-Signer component for TRUST2GO by GLOBALTRUST

License: MIT License

PHP 100.00%
php pdf signature digital-signature eidas globaltrust setapdf aatl setapdf-signer pades

setapdf-signer-addon-globaltrust-trust2go's People

Contributors

dependabot[bot] avatar janslabon avatar maximiliankresse avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

setapdf-signer-addon-globaltrust-trust2go's Issues

(some) certificates lack a description yielding an empty select box in the 2FA demo

In the 2FA demo you may end up with unnamed options in the certificate drop-down, rendering them invisible. This is due to the fact, that the description property of the returned certificates may be an empty string.

Unfortunately, this is not documented by TRUST2GO, but can be circumvented by naming the options with a combination of the certificateSerialNumber property and, if present, the description, like so.

let opt = '<option value="' + certificate.certificateSerialNumber + '">{{NAME}}</option>';
let name = certificate.certificateSerialNumber;
if (certificate.description) {
    name += ' (' + certificate.description + ')';
}
certificatesHtml += opt.replace('{{NAME}}', name);

From our experience, it's the user level certificates (the relevant ones) that do not have a description, whereas root and sub level certificates have one.

presign method provokes SetaPDF_Core_Type_IndirectReference_Exception

While fiddling with the 2FA demo, we ran into the following exception.

Fatal error: Uncaught SetaPDF_Core_Type_IndirectReference_Exception: Object could not be resolved (15, 0) in <REDACTED>/vendor/setasign/setapdf-signer_eval_ioncube_php7.1/library/SetaPDF/Core/Type/IndirectReference.php:172 Stack trace: 
#0 <REDACTED>/vendor/setasign/setapdf-signer_eval_ioncube_php7.1/library/SetaPDF/Core/Document.php(1839): SetaPDF_Core_Type_IndirectReference->ensure() 
#1 <REDACTED>/vendor/setasign/setapdf-signer_eval_ioncube_php7.1/library/SetaPDF/Core/Document.php(1506): SetaPDF_Core_Document->_updateFileIdentifier() 
#2 <REDACTED>/vendor/setasign/setapdf-signer_eval_ioncube_php7.1/library/SetaPDF/Signer.php(774): SetaPDF_Core_Document->save() 
#3 <REDACTED>/vendor/setasign/setapdf-signer_eval_ioncube_php7.1/library/SetaPDF/Signer.php(598): SetaPDF_Signer->_prepareTemporaryVersion() 
#4 <REDACTED>/public/controll in <REDACTED>/vendor/setasign/setapdf-signer_eval_ioncube_php7.1/library/SetaPDF/Core/Type/IndirectReference.php on line 172

We figured, that it is provoked by the presign()-method of the SetaPDF_Signer and it seems to be happening in connection with writing a temporary file. For this reason, we've changed the sys_temp_dir PHP option and set generous directory permissions. In any case, the file gets written and has the typical structure of a PDF file. Hence writing the file doesn't seem to be the problem. Since the stack trace mentions _updateFileIdentifier(), we wonder if there is anything unusual happening after writing the file and how the environment needs to be configured for this to work properly.

Some specs:

  • PHP 7.4.30 (FPM/FastCGI)
  • Apache 2.4.54
  • Ubuntu 22.04.1 LTS

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.