Browse Source

minor: remove unused code.

patch-2
Christopher Jeffrey 11 years ago
parent
commit
47e1ca5f1e
  1. 3
      lib/PayPro.js
  2. 2
      lib/browser/PayPro.js

3
lib/PayPro.js

@ -230,7 +230,6 @@ PayPro.prototype.sign = function(key) {
var der = pki_data.toString('hex');
var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(der, 'CERTIFICATE');
// var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY')
if (!Trusted[pem.replace(/\s+/g, '')]) {
// throw new Error('Unstrusted certificate.');
@ -276,13 +275,11 @@ PayPro.prototype.verify = function() {
var der = pki_data.toString('hex');
var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(der, 'CERTIFICATE');
// var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY')
if (!Trusted[pem.replace(/\s+/g, '')]) {
// throw new Error('Unstrusted certificate.');
}
// return verifier.verify(pub, sig);
return verifier.verify(pem, sig);
} else if (pki_type === 'none') {
return true;

2
lib/browser/PayPro.js

@ -35,7 +35,6 @@ PayPro.sign = function(key) {
var der = pki_data.toString('hex');
var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(der, 'CERTIFICATE');
// var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY')
if (!Trusted[pem.replace(/\s+/g, '')]) {
// throw new Error('Unstrusted certificate.');
@ -86,7 +85,6 @@ PayPro.verify = function() {
var der = pki_data.toString('hex');
var pem = KJUR.asn1.ASN1Util.getPEMStringFromHex(der, 'CERTIFICATE');
// var pub = KJUR.KEYUTIL.getHexFromPEM(pem, 'PUBLIC KEY')
if (!Trusted[pem.replace(/\s+/g, '')]) {
// throw new Error('Unstrusted certificate.');

Loading…
Cancel
Save