asn1-ts 7.1.1 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node/codecs/ber/decoders/decodeGeneralizedTime.d.ts.map +1 -1
- package/dist/node/codecs/ber/decoders/decodeGeneralizedTime.js +1 -8
- package/dist/node/codecs/ber/decoders/decodeGeneralizedTime.js.map +1 -1
- package/dist/node/codecs/ber/decoders/decodeUTCTime.d.ts.map +1 -1
- package/dist/node/codecs/ber/decoders/decodeUTCTime.js +2 -9
- package/dist/node/codecs/ber/decoders/decodeUTCTime.js.map +1 -1
- package/dist/node/codecs/der/decoders/decodeGeneralizedTime.d.ts.map +1 -1
- package/dist/node/codecs/der/decoders/decodeGeneralizedTime.js +1 -8
- package/dist/node/codecs/der/decoders/decodeGeneralizedTime.js.map +1 -1
- package/dist/node/codecs/der/decoders/decodeUTCTime.d.ts.map +1 -1
- package/dist/node/codecs/der/decoders/decodeUTCTime.js +2 -9
- package/dist/node/codecs/der/decoders/decodeUTCTime.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeGeneralizedTime.d.ts","sourceRoot":"","sources":["../../../../../source/codecs/ber/decoders/decodeGeneralizedTime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,OAAO,UACL,qBAAqB,CAAE,KAAK,EAAE,UAAU,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"decodeGeneralizedTime.d.ts","sourceRoot":"","sources":["../../../../../source/codecs/ber/decoders/decodeGeneralizedTime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,OAAO,UACL,qBAAqB,CAAE,KAAK,EAAE,UAAU,GAAG,eAAe,CAclE"}
|
|
@@ -11,7 +11,6 @@ function decodeGeneralizedTime(value) {
|
|
|
11
11
|
if (match === null) {
|
|
12
12
|
throw new errors.ASN1Error("Malformed GeneralizedTime string.");
|
|
13
13
|
}
|
|
14
|
-
const ret = new Date();
|
|
15
14
|
const year = Number(match[1]);
|
|
16
15
|
const month = (Number(match[2]) - 1);
|
|
17
16
|
const date = Number(match[3]);
|
|
@@ -19,13 +18,7 @@ function decodeGeneralizedTime(value) {
|
|
|
19
18
|
const minutes = Number(match[5]);
|
|
20
19
|
const seconds = Number(match[6]);
|
|
21
20
|
(0, validateDateTime_1.default)("GeneralizedTime", year, month, date, hours, minutes, seconds);
|
|
22
|
-
|
|
23
|
-
ret.setUTCMonth(month);
|
|
24
|
-
ret.setUTCDate(date);
|
|
25
|
-
ret.setUTCHours(hours);
|
|
26
|
-
ret.setUTCMinutes(minutes);
|
|
27
|
-
ret.setUTCSeconds(seconds);
|
|
28
|
-
return ret;
|
|
21
|
+
return new Date(Date.UTC(year, month, date, hours, minutes, seconds));
|
|
29
22
|
}
|
|
30
23
|
exports.default = decodeGeneralizedTime;
|
|
31
24
|
//# sourceMappingURL=decodeGeneralizedTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeGeneralizedTime.js","sourceRoot":"","sources":["../../../../../source/codecs/ber/decoders/decodeGeneralizedTime.ts"],"names":[],"mappings":";;;AAAA,gEAA0C;AAC1C,mGAAmE;AACnE,4CAAuD;AACvD,oGAAoE;AAGpE,SACS,qBAAqB,CAAE,KAAiB;IAC7C,MAAM,UAAU,GAAW,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAAC;IACrD,MAAM,KAAK,GAA2B,6BAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5E,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;KACnE;IACD,MAAM,
|
|
1
|
+
{"version":3,"file":"decodeGeneralizedTime.js","sourceRoot":"","sources":["../../../../../source/codecs/ber/decoders/decodeGeneralizedTime.ts"],"names":[],"mappings":";;;AAAA,gEAA0C;AAC1C,mGAAmE;AACnE,4CAAuD;AACvD,oGAAoE;AAGpE,SACS,qBAAqB,CAAE,KAAiB;IAC7C,MAAM,UAAU,GAAW,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAAC;IACrD,MAAM,KAAK,GAA2B,6BAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5E,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;KACnE;IACD,MAAM,IAAI,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAA,0BAAgB,EAAC,iBAAiB,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAChF,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC;AAfD,wCAeC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeUTCTime.d.ts","sourceRoot":"","sources":["../../../../../source/codecs/ber/decoders/decodeUTCTime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,OAAO,UACL,aAAa,CAAE,KAAK,EAAE,UAAU,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"decodeUTCTime.d.ts","sourceRoot":"","sources":["../../../../../source/codecs/ber/decoders/decodeUTCTime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,OAAO,UACL,aAAa,CAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAwBlD"}
|
|
@@ -7,11 +7,10 @@ const values_1 = require("../../../values");
|
|
|
7
7
|
const validateDateTime_1 = tslib_1.__importDefault(require("../../../validators/validateDateTime"));
|
|
8
8
|
function decodeUTCTime(value) {
|
|
9
9
|
const dateString = (0, convertBytesToText_1.default)(value);
|
|
10
|
-
const match = values_1.
|
|
10
|
+
const match = values_1.utcTimeRegex.exec(dateString);
|
|
11
11
|
if (match === null) {
|
|
12
12
|
throw new errors.ASN1Error("Malformed UTCTime string.");
|
|
13
13
|
}
|
|
14
|
-
const ret = new Date();
|
|
15
14
|
let year = Number(match[1]);
|
|
16
15
|
year = (year <= 49)
|
|
17
16
|
? (2000 + year)
|
|
@@ -22,13 +21,7 @@ function decodeUTCTime(value) {
|
|
|
22
21
|
const minutes = Number(match[5]);
|
|
23
22
|
const seconds = Number(match[6]);
|
|
24
23
|
(0, validateDateTime_1.default)("UTCTime", year, month, date, hours, minutes, seconds);
|
|
25
|
-
|
|
26
|
-
ret.setUTCMonth(month);
|
|
27
|
-
ret.setUTCDate(date);
|
|
28
|
-
ret.setUTCHours(hours);
|
|
29
|
-
ret.setUTCMinutes(minutes);
|
|
30
|
-
ret.setUTCSeconds(seconds);
|
|
31
|
-
return ret;
|
|
24
|
+
return new Date(Date.UTC(year, month, date, hours, minutes, seconds));
|
|
32
25
|
}
|
|
33
26
|
exports.default = decodeUTCTime;
|
|
34
27
|
//# sourceMappingURL=decodeUTCTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeUTCTime.js","sourceRoot":"","sources":["../../../../../source/codecs/ber/decoders/decodeUTCTime.ts"],"names":[],"mappings":";;;AAAA,mGAAmE;AACnE,gEAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"decodeUTCTime.js","sourceRoot":"","sources":["../../../../../source/codecs/ber/decoders/decodeUTCTime.ts"],"names":[],"mappings":";;;AAAA,mGAAmE;AACnE,gEAA0C;AAC1C,4CAA+C;AAC/C,oGAAoE;AAGpE,SACS,aAAa,CAAE,KAAiB;IACrC,MAAM,UAAU,GAAW,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAAC;IACrD,MAAM,KAAK,GAA2B,qBAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpE,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;KAC3D;IACD,IAAI,IAAI,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAQpC,IAAI,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;QACf,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACpB,MAAM,KAAK,GAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAA,0BAAgB,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACxE,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC;AAzBD,gCAyBC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeGeneralizedTime.d.ts","sourceRoot":"","sources":["../../../../../source/codecs/der/decoders/decodeGeneralizedTime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,OAAO,UACL,qBAAqB,CAAE,KAAK,EAAE,UAAU,GAAG,eAAe,
|
|
1
|
+
{"version":3,"file":"decodeGeneralizedTime.d.ts","sourceRoot":"","sources":["../../../../../source/codecs/der/decoders/decodeGeneralizedTime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,OAAO,UACL,qBAAqB,CAAE,KAAK,EAAE,UAAU,GAAG,eAAe,CAclE"}
|
|
@@ -11,7 +11,6 @@ function decodeGeneralizedTime(value) {
|
|
|
11
11
|
if (match === null) {
|
|
12
12
|
throw new errors.ASN1Error("Malformed GeneralizedTime string.");
|
|
13
13
|
}
|
|
14
|
-
const ret = new Date();
|
|
15
14
|
const year = Number(match[1]);
|
|
16
15
|
const month = (Number(match[2]) - 1);
|
|
17
16
|
const date = Number(match[3]);
|
|
@@ -19,13 +18,7 @@ function decodeGeneralizedTime(value) {
|
|
|
19
18
|
const minutes = Number(match[5]);
|
|
20
19
|
const seconds = Number(match[6]);
|
|
21
20
|
(0, validateDateTime_1.default)("GeneralizedTime", year, month, date, hours, minutes, seconds);
|
|
22
|
-
|
|
23
|
-
ret.setUTCMonth(month);
|
|
24
|
-
ret.setUTCDate(date);
|
|
25
|
-
ret.setUTCHours(hours);
|
|
26
|
-
ret.setUTCMinutes(minutes);
|
|
27
|
-
ret.setUTCSeconds(seconds);
|
|
28
|
-
return ret;
|
|
21
|
+
return new Date(Date.UTC(year, month, date, hours, minutes, seconds));
|
|
29
22
|
}
|
|
30
23
|
exports.default = decodeGeneralizedTime;
|
|
31
24
|
//# sourceMappingURL=decodeGeneralizedTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeGeneralizedTime.js","sourceRoot":"","sources":["../../../../../source/codecs/der/decoders/decodeGeneralizedTime.ts"],"names":[],"mappings":";;;AAAA,mGAAmE;AACnE,4CAAoE;AACpE,gEAA0C;AAC1C,oGAAoE;AAGpE,SACS,qBAAqB,CAAE,KAAiB;IAC7C,MAAM,UAAU,GAAW,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAAC;IACrD,MAAM,KAAK,GAA2B,0CAAiC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzF,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;KACnE;IACD,MAAM,
|
|
1
|
+
{"version":3,"file":"decodeGeneralizedTime.js","sourceRoot":"","sources":["../../../../../source/codecs/der/decoders/decodeGeneralizedTime.ts"],"names":[],"mappings":";;;AAAA,mGAAmE;AACnE,4CAAoE;AACpE,gEAA0C;AAC1C,oGAAoE;AAGpE,SACS,qBAAqB,CAAE,KAAiB;IAC7C,MAAM,UAAU,GAAW,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAAC;IACrD,MAAM,KAAK,GAA2B,0CAAiC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzF,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,mCAAmC,CAAC,CAAC;KACnE;IACD,MAAM,IAAI,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAA,0BAAgB,EAAC,iBAAiB,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAChF,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC;AAfD,wCAeC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeUTCTime.d.ts","sourceRoot":"","sources":["../../../../../source/codecs/der/decoders/decodeUTCTime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,OAAO,UACL,aAAa,CAAE,KAAK,EAAE,UAAU,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"decodeUTCTime.d.ts","sourceRoot":"","sources":["../../../../../source/codecs/der/decoders/decodeUTCTime.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,CAAC,OAAO,UACL,aAAa,CAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAwBlD"}
|
|
@@ -7,11 +7,10 @@ const errors = tslib_1.__importStar(require("../../../errors"));
|
|
|
7
7
|
const validateDateTime_1 = tslib_1.__importDefault(require("../../../validators/validateDateTime"));
|
|
8
8
|
function decodeUTCTime(value) {
|
|
9
9
|
const dateString = (0, convertBytesToText_1.default)(value);
|
|
10
|
-
const match = values_1.
|
|
10
|
+
const match = values_1.distinguishedUTCTimeRegex.exec(dateString);
|
|
11
11
|
if (match === null) {
|
|
12
12
|
throw new errors.ASN1Error("Malformed UTCTime string.");
|
|
13
13
|
}
|
|
14
|
-
const ret = new Date();
|
|
15
14
|
let year = Number(match[1]);
|
|
16
15
|
year = (year <= 49)
|
|
17
16
|
? (2000 + year)
|
|
@@ -22,13 +21,7 @@ function decodeUTCTime(value) {
|
|
|
22
21
|
const minutes = Number(match[5]);
|
|
23
22
|
const seconds = Number(match[6]);
|
|
24
23
|
(0, validateDateTime_1.default)("UTCTime", year, month, date, hours, minutes, seconds);
|
|
25
|
-
|
|
26
|
-
ret.setUTCMonth(month);
|
|
27
|
-
ret.setUTCDate(date);
|
|
28
|
-
ret.setUTCHours(hours);
|
|
29
|
-
ret.setUTCMinutes(minutes);
|
|
30
|
-
ret.setUTCSeconds(seconds);
|
|
31
|
-
return ret;
|
|
24
|
+
return new Date(Date.UTC(year, month, date, hours, minutes, seconds));
|
|
32
25
|
}
|
|
33
26
|
exports.default = decodeUTCTime;
|
|
34
27
|
//# sourceMappingURL=decodeUTCTime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeUTCTime.js","sourceRoot":"","sources":["../../../../../source/codecs/der/decoders/decodeUTCTime.ts"],"names":[],"mappings":";;;AAAA,mGAAmE;AACnE,
|
|
1
|
+
{"version":3,"file":"decodeUTCTime.js","sourceRoot":"","sources":["../../../../../source/codecs/der/decoders/decodeUTCTime.ts"],"names":[],"mappings":";;;AAAA,mGAAmE;AACnE,4CAA4D;AAC5D,gEAA0C;AAC1C,oGAAoE;AAGpE,SACS,aAAa,CAAE,KAAiB;IACrC,MAAM,UAAU,GAAW,IAAA,4BAAkB,EAAC,KAAK,CAAC,CAAC;IACrD,MAAM,KAAK,GAA2B,kCAAyB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACjF,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,2BAA2B,CAAC,CAAC;KAC3D;IACD,IAAI,IAAI,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAQpC,IAAI,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;QACf,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC;QACf,CAAC,CAAC,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACpB,MAAM,KAAK,GAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7C,MAAM,IAAI,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,OAAO,GAAW,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACzC,IAAA,0BAAgB,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACxE,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1E,CAAC;AAzBD,gCAyBC"}
|