|
|
@ -198,28 +198,32 @@ PayPro.prototype.x509Verify = function() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var rejectUnknown = !!extensions.unknown.filter(function(ext) { |
|
|
|
var extensionsVerified = !extensions.unknown.filter(function(ext) { |
|
|
|
return ext.critical; |
|
|
|
}).length; |
|
|
|
|
|
|
|
print(c); |
|
|
|
print(nc); |
|
|
|
print(extensions); |
|
|
|
print('issuerVerified: %s', issuerVerified); |
|
|
|
print('rejectUnknown: %s', rejectUnknown); |
|
|
|
print('validityVerified: %s', validityVerified); |
|
|
|
|
|
|
|
//
|
|
|
|
// Create a To-Be-Signed Certificate to verify using asn1.js:
|
|
|
|
//
|
|
|
|
var tbs = rfc3280.TBSCertificate.encode(c.tbsCertificate, 'der'); |
|
|
|
|
|
|
|
//
|
|
|
|
// Verify current certificate signature:
|
|
|
|
//
|
|
|
|
|
|
|
|
// Create a To-Be-Signed Certificate to verify using asn1.js:
|
|
|
|
var tbs = rfc3280.TBSCertificate.encode(c.tbsCertificate, 'der'); |
|
|
|
var verifier = crypto.createVerify('RSA-' + sigAlg); |
|
|
|
verifier.update(tbs); |
|
|
|
return verifier.verify(npubKey, sig) && issuerVerified; |
|
|
|
var sigVerified = verifier.verify(npubKey, sig); |
|
|
|
|
|
|
|
print(c); |
|
|
|
print(nc); |
|
|
|
print(extensions); |
|
|
|
print('validityVerified: %s', validityVerified); |
|
|
|
print('issuerVerified: %s', issuerVerified); |
|
|
|
print('extensionsVerified: %s', extensionsVerified); |
|
|
|
print('sigVerified: %s', validityVerified); |
|
|
|
|
|
|
|
return validityVerified |
|
|
|
&& issuerVerified |
|
|
|
&& extensionsVerified |
|
|
|
&& sigVerified; |
|
|
|
}); |
|
|
|
|
|
|
|
return verified && chainVerified; |
|
|
|