|
@ -98,16 +98,6 @@ PayPro.prototype.x509Verify = function() { |
|
|
// Get signature from current certificate:
|
|
|
// Get signature from current certificate:
|
|
|
var data = new Buffer(der, 'hex'); |
|
|
var data = new Buffer(der, 'hex'); |
|
|
var c = rfc3280.Certificate.decode(data, 'der'); |
|
|
var c = rfc3280.Certificate.decode(data, 'der'); |
|
|
|
|
|
|
|
|
// console.log(c._rawTags);
|
|
|
|
|
|
// console.log(c._rawTags[0]._rawTags['seq:0']);
|
|
|
|
|
|
// var tbsData = c._rawTags[0]._rawTags['seq:0'].input.base;
|
|
|
|
|
|
// console.log(tbsData.toString('hex'));
|
|
|
|
|
|
// //var tbsData = c._rawTags[0]._baseState.children[0]._rawTags[0].input.base;
|
|
|
|
|
|
// //console.log(tbsData.toString('hex'));
|
|
|
|
|
|
// //var tc = rfc3280.TBSCertificate.decode(tbsData, 'der');
|
|
|
|
|
|
// //console.log(tc);
|
|
|
|
|
|
|
|
|
|
|
|
var sig = c.signature.data; |
|
|
var sig = c.signature.data; |
|
|
|
|
|
|
|
|
var verifier = crypto.createVerify('RSA-' + type); |
|
|
var verifier = crypto.createVerify('RSA-' + type); |
|
@ -115,10 +105,6 @@ PayPro.prototype.x509Verify = function() { |
|
|
// Create a To-Be-Signed Certificate to verify using asn1.js:
|
|
|
// Create a To-Be-Signed Certificate to verify using asn1.js:
|
|
|
// Fails at Issuer:
|
|
|
// Fails at Issuer:
|
|
|
var tbs = rfc3280.TBSCertificate.encode(c.tbsCertificate, 'der'); |
|
|
var tbs = rfc3280.TBSCertificate.encode(c.tbsCertificate, 'der'); |
|
|
//var tbs = c._rawTags[0]._baseState.children[0]._rawTags[100].input.base.slice(
|
|
|
|
|
|
// //c._rawTags[0]._baseState.children[0]._rawTags[100].input.offset
|
|
|
|
|
|
// 0, c._rawTags[0]._baseState.children[0]._rawTags[100].input.length
|
|
|
|
|
|
//);
|
|
|
|
|
|
verifier.update(tbs); |
|
|
verifier.update(tbs); |
|
|
|
|
|
|
|
|
return verifier.verify(npubKey, sig); |
|
|
return verifier.verify(npubKey, sig); |
|
|