lib/agent/socket_util.js
function validateCert(cert, cb)
{
  // if we already have an entry in the cache, use it
  var ocspResponse = getOcspResponseCache().get(cert);
  if (ocspResponse)
  {
    process.nextTick(function()
    {
      Logger.getInstance().trace('Returning OCSP status for certificate %s ' +
          'from cache', cert.serialNumber);

      cb(null, ocspResponse);
    });
  }
  else
  {
    try
    {
      var decoded = CertUtil.decode(cert);
    }
    catch(e)
    {
      process.nextTick(function()
      {
        cb(e);
      });
    }

    // issue a request to get the ocsp status
    check(decoded, cb);
  }
}
function validateCert(cert, cb)
{
  // if we already have an entry in the cache, use it
  var ocspResponse = getOcspResponseCache().get(cert);
  if (ocspResponse)
  {
    process.nextTick(function()
    {
      Logger.getInstance().trace('Returning OCSP status for certificate %s ' +
          'from cache', cert.serialNumber);

      cb(null, ocspResponse);
    });
  }
  else
  {
    try
    {
      var decoded = CertUtil.decode(cert);
    }
    catch(e)
    {
      process.nextTick(function()
      {
        cb(e);
      });
    }

    // issue a request to get the ocsp status
    check(decoded, cb);
  }
}
function validateCert ( cert , cb ) { // if we already have an entry in the cache, use it var ocspResponse = getOcspResponseCache ( ) . get ( cert ) ; if ( ocspResponse ) { process . nextTick ( function ( ) { Logger . getInstance ( ) . trace ( 'Returning OCSP status for certificate %s ' + 'from cache' , cert . serialNumber ) ; cb ( null , ocspResponse ) ; } ) ; } else { try { var decoded = CertUtil . decode ( cert ) ; } catch ( e ) { process . nextTick ( function ( ) { cb ( e ) ; } ) ; } // issue a request to get the ocsp status check ( decoded , cb ) ; } }
Validates a certificate using OCSP.

@param cert the certificate to validate.
@param cb the callback to invoke once the validation is complete.
Validates a certificate using OCSP .