parent
b406eeadff
commit
6dbff09d40
|
@ -98,7 +98,6 @@ 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.tbsCertificate);
|
||||
var sig = c.signature.data;
|
||||
|
||||
var verifier = crypto.createVerify('RSA-' + type);
|
||||
|
@ -106,13 +105,6 @@ 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 tbsd = rfc3280.TBSCertificate.decode(tbs, 'der');
|
||||
console.log(tbsd);
|
||||
console.log('original cert:');
|
||||
console.log(data.toString('hex'));
|
||||
console.log('encoded tbs:');
|
||||
console.log(tbs.toString('hex'));
|
||||
console.log(data.toString('hex').indexOf(tbs.toString('hex')));
|
||||
verifier.update(tbs);
|
||||
|
||||
return verifier.verify(npubKey, sig);
|
||||
|
|
Loading…
Reference in New Issue