verify signing chain with pem
<p>I need to verify a signing chain mit pem in nodejs.
I found the function <code>pem.verifySigningChain(certificate, ca, callback)</code>.
But how do I use callback to give me the message that the signing chain is correct or the test failed?
Has anyone a simple example?</p>

<p><strong>EDIT</strong></p>

<pre><code>db.getCert(certificate, function(certificate) {
        if (certificate){
                db.getCaCert(caCert, function(caCert) {
                        if (caCert){
                                pem.verifySigningChain(certificate, caCert, function (err){
                                  if(err){
                                    console.log(err);
                                  }
                                  console.log("Signing Chain okay");
                                 })
                          }
                      }
                 }
         }
</code></pre>