paypro: asn1.js debugging - try to get tbs buffer.
This commit is contained in:
parent
11c478d1a9
commit
3c7aeb4f62
|
@ -98,6 +98,16 @@ PayPro.prototype.x509Verify = function() {
|
|||
// Get signature from current certificate:
|
||||
var data = new Buffer(der, 'hex');
|
||||
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 verifier = crypto.createVerify('RSA-' + type);
|
||||
|
@ -105,6 +115,10 @@ PayPro.prototype.x509Verify = function() {
|
|||
// Create a To-Be-Signed Certificate to verify using asn1.js:
|
||||
// Fails at Issuer:
|
||||
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);
|
||||
|
||||
return verifier.verify(npubKey, sig);
|
||||
|
|
Loading…
Reference in New Issue