Browse Source

paypro: start handling certificate extensions.

patch-2
Christopher Jeffrey 11 years ago
parent
commit
95a75a6ee4
  1. 40
      lib/PayPro.js

40
lib/PayPro.js

@ -128,6 +128,46 @@ PayPro.prototype.x509Verify = function() {
});
});
//
// Handle Cert Extensions
// http://tools.ietf.org/html/rfc5280#section-4.2
//
// Basic Constraints
var basicConstraints = nc.tbsCertificate.extensions.filter(function(ext) {
return ext.extnID[3] === 19;
})[0];
// Key Usage
var keyUsage = nc.tbsCertificate.extensions.filter(function(ext) {
return ext.extnID[3] === 15;
})[0];
// Subject Key Identifier
var authKeyIdentifier = nc.tbsCertificate.extensions.filter(function(ext) {
return ext.extnID[3] === 14;
})[0];
// Authority Key Identifier
var authKeyIdentifier = nc.tbsCertificate.extensions.filter(function(ext) {
return ext.extnID[3] === 35;
})[0];
// Unknown Extension (not documented anywhere, probably non-standard)
var unknown = nc.tbsCertificate.extensions.filter(function(ext) {
return ext.extnID[3] === 1;
})[0];
// CRL Distribution Points
var CRLDistributionPoints = nc.tbsCertificate.extensions.filter(function(ext) {
return ext.extnID[3] === 31;
})[0];
// Certificate Policies
var certPolicies = nc.tbsCertificate.extensions.filter(function(ext) {
return ext.extnID[3] === 32;
})[0];
//
// Create a To-Be-Signed Certificate to verify using asn1.js:
//

Loading…
Cancel
Save