mirror of
https://github.com/therootcompany/x509.js.git
synced 2025-05-09 15:46:40 +00:00
v0.7.1: publish correct browser distributables
This commit is contained in:
parent
023669ad6b
commit
b051cb96b0
@ -8,8 +8,8 @@ and [Keypairs.js](https://git.rootprojects.org/root/keypairs.js)
|
||||
Lightweight, Zero-Dependency, x509 encoder and decoder for Node.js and Browsers
|
||||
|
||||
| 1.6k gzipped
|
||||
| 6.9k minified
|
||||
| 9.9k pretty
|
||||
| 6.8k minified
|
||||
| 9.7k pretty
|
||||
|
|
||||
|
||||
This provides a set ASN.1 / x509 schemas for DER encoding and decoding
|
||||
|
15
dist/x509.all.js
vendored
15
dist/x509.all.js
vendored
@ -665,23 +665,13 @@ X509.parseRsaPkcs8 = function parseRsaPkcs8(asn1, jwk) {
|
||||
|
||||
// might be a buffer
|
||||
if (!Array.isArray(asn1)) {
|
||||
/*
|
||||
console.log(
|
||||
JSON.stringify(ASN1.parse({ der: asn1, verbose: true, json: false }), null, 2)
|
||||
);
|
||||
*/
|
||||
asn1 = ASN1.parse({ der: asn1, verbose: true, json: false });
|
||||
}
|
||||
if (
|
||||
2 === asn1.children.length &&
|
||||
0x03 === asn1.children[1].type &&
|
||||
0x30 === asn1.children[1].value[0]
|
||||
0x03 === asn1.children[1].type // && 2 === asn1.children[1].children.length
|
||||
) {
|
||||
asn1 = ASN1.parse({
|
||||
der: asn1.children[1].value,
|
||||
verbose: true,
|
||||
json: false
|
||||
});
|
||||
asn1 = asn1.children[1].children[0];
|
||||
jwk.n = Enc.bufToUrlBase64(asn1.children[0].value);
|
||||
jwk.e = Enc.bufToUrlBase64(asn1.children[1].value);
|
||||
jwk.kty = 'RSA';
|
||||
@ -713,7 +703,6 @@ X509.parseSpki = function(buf, jwk) {
|
||||
try {
|
||||
return X509.parseRsaPkcs8(buf, jwk);
|
||||
} catch (e) {
|
||||
//console.error(e);
|
||||
return X509.parseEcSpki(buf, jwk);
|
||||
}
|
||||
};
|
||||
|
2
dist/x509.all.min.js
vendored
2
dist/x509.all.min.js
vendored
File diff suppressed because one or more lines are too long
15
dist/x509.js
vendored
15
dist/x509.js
vendored
@ -147,23 +147,13 @@ X509.parseRsaPkcs8 = function parseRsaPkcs8(asn1, jwk) {
|
||||
|
||||
// might be a buffer
|
||||
if (!Array.isArray(asn1)) {
|
||||
/*
|
||||
console.log(
|
||||
JSON.stringify(ASN1.parse({ der: asn1, verbose: true, json: false }), null, 2)
|
||||
);
|
||||
*/
|
||||
asn1 = ASN1.parse({ der: asn1, verbose: true, json: false });
|
||||
}
|
||||
if (
|
||||
2 === asn1.children.length &&
|
||||
0x03 === asn1.children[1].type &&
|
||||
0x30 === asn1.children[1].value[0]
|
||||
0x03 === asn1.children[1].type // && 2 === asn1.children[1].children.length
|
||||
) {
|
||||
asn1 = ASN1.parse({
|
||||
der: asn1.children[1].value,
|
||||
verbose: true,
|
||||
json: false
|
||||
});
|
||||
asn1 = asn1.children[1].children[0];
|
||||
jwk.n = Enc.bufToUrlBase64(asn1.children[0].value);
|
||||
jwk.e = Enc.bufToUrlBase64(asn1.children[1].value);
|
||||
jwk.kty = 'RSA';
|
||||
@ -195,7 +185,6 @@ X509.parseSpki = function(buf, jwk) {
|
||||
try {
|
||||
return X509.parseRsaPkcs8(buf, jwk);
|
||||
} catch (e) {
|
||||
//console.error(e);
|
||||
return X509.parseEcSpki(buf, jwk);
|
||||
}
|
||||
};
|
||||
|
2
dist/x509.min.js
vendored
2
dist/x509.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@root/x509",
|
||||
"version": "0.7.0",
|
||||
"version": "0.7.1",
|
||||
"description": "VanillaJS, Lightweight, Zero-Dependency, X509 schema encoder and decoder.",
|
||||
"main": "index.js",
|
||||
"browser": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user