paypro: debug KeyUsage extension.

This commit is contained in:
Christopher Jeffrey 2014-08-25 11:57:29 -07:00
parent 6f8de47983
commit eedf71a749
1 changed files with 41 additions and 0 deletions

View File

@ -213,6 +213,20 @@ PayPro.prototype.x509Verify = function() {
print(extensions.authorityKeyIdentifier);
}
// if (extensions.subjectKeyIdentifier) {
// extensions.subjectKeyIdentifier = rfc5280.SubjectKeyIdentifier.decode(
// extensions.subjectKeyIdentifier,
// 'der');
// print(extensions.subjectKeyIdentifier);
// }
if (extensions.keyUsage) {
extensions.keyUsage = rfc5280.KeyUsage.decode(
extensions.keyUsage,
'der');
print(extensions.keyUsage);
}
//
// Verify current certificate signature
//
@ -246,6 +260,7 @@ PayPro.prototype.x509Verify = function() {
*/
var rfc5280 = {};
rfc5280.AuthorityKeyIdentifier = asn1.define('AuthorityKeyIdentifier', function() {
this.seq().obj(
this.key('keyIdentifier').optional().octstr(),
@ -254,6 +269,32 @@ rfc5280.AuthorityKeyIdentifier = asn1.define('AuthorityKeyIdentifier', function(
);
});
// rfc5280.SubjectKeyIdentifier = asn1.define('SubjectKeyIdentifier', function() {
// this.seq().obj(
// this.key('keyIdentifier').optional().octstr(),
// this.key('authorityCertIssuer').optional().octstr(),
// this.key('authorityCertSerialNumber').optional().octstr()
// );
// });
rfc5280.KeyUsage = asn1.define('KeyUsage', function() {
this.bitstr();
});
rfc5280.KeyUsage = asn1.define('KeyUsage', function() {
this.seq().obj(
this.key('digitalSignature').bitstr(),
this.key('nonRepudiation').bitstr(),
this.key('keyEncipherment').bitstr(),
this.key('dataEncipherment').bitstr(),
this.key('keyAgreement').bitstr(),
this.key('keyCertSign').bitstr(),
this.key('cRLSign').bitstr(),
this.key('encipherOnly').bitstr(),
this.key('decipherOnly').bitstr()
);
});
/**
* Debug
*/