Comparing version 2.0.64 to 2.0.66
@@ -72,4 +72,4 @@ { | ||
"name": "pkijs", | ||
"version": "2.0.64", | ||
"version": "2.0.66", | ||
"license": "MIT" | ||
} |
@@ -52,3 +52,3 @@ import * as asn1js from "asn1js"; | ||
*/ | ||
static schema(parameters = {}) | ||
static schema(parameters = {}, optional = false) | ||
{ | ||
@@ -61,7 +61,9 @@ /** | ||
const names = getParametersValue(parameters, "names", {}); | ||
return (new asn1js.Sequence({ | ||
optional, | ||
name: (names.blockName || ""), | ||
value: [ | ||
new asn1js.Repeated({ | ||
name: (names.blockName || "names"), | ||
name: (names.generalNames || ""), | ||
value: GeneralName.schema() | ||
@@ -82,3 +84,8 @@ }) | ||
schema, | ||
GeneralNames.schema() | ||
GeneralNames.schema({ | ||
names: { | ||
blockName: "names", | ||
generalNames: "generalNames" | ||
} | ||
}) | ||
); | ||
@@ -91,3 +98,3 @@ | ||
//region Get internal properties from parsed schema | ||
this.names = Array.from(asn1.result.names, element => new GeneralName({ schema: element })); | ||
this.names = Array.from(asn1.result.generalNames, element => new GeneralName({ schema: element })); | ||
//endregion | ||
@@ -94,0 +101,0 @@ } |
@@ -29,12 +29,16 @@ import * as asn1js from "asn1js"; | ||
this.iterationCount = getParametersValue(parameters, "iterationCount", PBKDF2Params.defaultValues("iterationCount")); | ||
/** | ||
* @type {number} | ||
* @description keyLength | ||
*/ | ||
this.keyLength = getParametersValue(parameters, "keyLength", PBKDF2Params.defaultValues("keyLength")); | ||
/** | ||
* @type {AlgorithmIdentifier} | ||
* @description prf | ||
*/ | ||
this.prf = getParametersValue(parameters, "prf", PBKDF2Params.defaultValues("prf")); | ||
if("keyLength" in parameters) | ||
/** | ||
* @type {number} | ||
* @description keyLength | ||
*/ | ||
this.keyLength = getParametersValue(parameters, "keyLength", PBKDF2Params.defaultValues("keyLength")); | ||
if("prf" in parameters) | ||
/** | ||
* @type {AlgorithmIdentifier} | ||
* @description prf | ||
*/ | ||
this.prf = getParametersValue(parameters, "prf", PBKDF2Params.defaultValues("prf")); | ||
//endregion | ||
@@ -63,3 +67,6 @@ | ||
case "prf": | ||
return new AlgorithmIdentifier(); | ||
return new AlgorithmIdentifier({ | ||
algorithmId: "1.3.14.3.2.26", // SHA-1 | ||
algorithmParams: new asn1js.Null() | ||
}); | ||
default: | ||
@@ -66,0 +73,0 @@ throw new Error(`Invalid member name for PBKDF2Params class: ${memberName}`); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28854
988258
114