Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
outputArray.push(new asn1js.Constructed({
optional: true,
idBlock: {
tagClass: 3, // CONTEXT-SPECIFIC
tagNumber: 3 // [3]
},
value: [new asn1js.Sequence({
value: Array.from(this.extensions, element => element.toSchema())
})]
}));
}
//endregion
//region Create and return output sequence
return (new asn1js.Sequence({
value: outputArray
}));
//endregion
}
//**********************************************************************************
* @property {string} [tbsCertificateVersion]
* @property {string} [tbsCertificateSerialNumber]
* @property {string} [signature]
* @property {string} [issuer]
* @property {string} [tbsCertificateValidity]
* @property {string} [notBefore]
* @property {string} [notAfter]
* @property {string} [subject]
* @property {string} [subjectPublicKeyInfo]
* @property {string} [tbsCertificateIssuerUniqueID]
* @property {string} [tbsCertificateSubjectUniqueID]
* @property {string} [extensions]
*/
const names = getParametersValue(parameters, "names", {});
return (new asn1js.Sequence({
name: (names.blockName || "tbsCertificate"),
value: [
new asn1js.Constructed({
optional: true,
idBlock: {
tagClass: 3, // CONTEXT-SPECIFIC
tagNumber: 0 // [0]
},
value: [
new asn1js.Integer({ name: (names.tbsCertificateVersion || "tbsCertificate.version") }) // EXPLICIT integer value
]
}),
new asn1js.Integer({ name: (names.tbsCertificateSerialNumber || "tbsCertificate.serialNumber") }),
AlgorithmIdentifier.schema(names.signature || {
names: {
blockName: "tbsCertificate.signature"
{
sequenceLengthBlock.isIndefiniteForm = this.encryptedContent.idBlock.isConstructed;
const encryptedValue = this.encryptedContent;
encryptedValue.idBlock.tagClass = 3; // CONTEXT-SPECIFIC
encryptedValue.idBlock.tagNumber = 0; // [0]
encryptedValue.lenBlock.isIndefiniteForm = this.encryptedContent.idBlock.isConstructed;
outputArray.push(encryptedValue);
}
//endregion
//region Construct and return new ASN.1 schema for this object
return (new asn1js.Sequence({
lenBlock: sequenceLengthBlock,
value: outputArray
}));
//endregion
}
//**********************************************************************************
new asn1js.Sequence({
value: Array.from(this.crlVals, element => element.toSchema())
})
]
}));
}
if("ocspVals" in this)
{
outputArray.push(new asn1js.Constructed({
idBlock: {
tagClass: 3, // CONTEXT-SPECIFIC
tagNumber: 1 // [1]
},
value: [
new asn1js.Sequence({
value: Array.from(this.ocspVals, element => element.toSchema())
})
]
}));
}
if("otherRevVals" in this)
{
outputArray.push(new asn1js.Constructed({
idBlock: {
tagClass: 3, // CONTEXT-SPECIFIC
tagNumber: 2 // [2]
},
value: [this.otherRevVals.toSchema()]
}));
}
//region Create array for output sequence
const outputArray = [];
if(this.version !== CertificateRevocationList.defaultValues("version"))
outputArray.push(new asn1js.Integer({ value: this.version }));
outputArray.push(this.signature.toSchema());
outputArray.push(this.issuer.toSchema());
outputArray.push(this.thisUpdate.toSchema());
if("nextUpdate" in this)
outputArray.push(this.nextUpdate.toSchema());
if("revokedCertificates" in this)
{
outputArray.push(new asn1js.Sequence({
value: Array.from(this.revokedCertificates, element => element.toSchema())
}));
}
if("crlExtensions" in this)
{
outputArray.push(new asn1js.Constructed({
optional: true,
idBlock: {
tagClass: 3, // CONTEXT-SPECIFIC
tagNumber: 0 // [0]
},
value: [
this.crlExtensions.toSchema()
]
}));
toSchema()
{
//region Construct and return new ASN.1 schema for this object
return (new asn1js.Sequence({
value: [
this.rid.toSchema(),
this.encryptedKey
]
}));
//endregion
}
//**********************************************************************************
new Asn1js.Set({
name: "MetaDataValue",
value: [
new Asn1js.OctetString({
name: "RealContent"
})
]
})
]
})
})
]
})
]
});
var eku_schema = new Asn1js.Sequence({
name: "EKU",
value: [
new Asn1js.Repeated({
name: "OID",
value: new Asn1js.ObjectIdentifier()
})
]
});
var evoid_schema = new Asn1js.Sequence({
name: "EVOIDS",
value: [
new Asn1js.Repeated({
name: "PolicyThing",
value: new Asn1js.Sequence({
value: [
new Asn1js.ObjectIdentifier({
* @property {string} [sigPolicyId]
* @property {string} [sigPolicyHash]
* @property {string} [sigPolicyQualifiers]
*/
const names = getParametersValue(parameters, "names", {});
return (new asn1js.Sequence({
name: (names.blockName || ""),
value: [
new asn1js.ObjectIdentifier({ name: (names.sigPolicyId || "") }),
OtherHashAlgAndValue.schema(names.sigPolicyHash || {
names: {
blockName: ""
}
}),
new asn1js.Sequence({
optional: true,
value: [
new asn1js.Repeated({
name: (names.sigPolicyQualifiers || ""),
value: SigPolicyQualifierInfo.schema()
})
]
})
]
}));
}
//**********************************************************************************
static schema(parameters = {})
{
/**
* @type {Object}
* @property {string} [blockName]
* @property {string} [certificationRequestInfo]
* @property {string} [signatureAlgorithm]
* @property {string} [signatureValue]
*/
const names = getParametersValue(parameters, "names", {});
return (new asn1js.Sequence({
value: [
CertificationRequestInfo(names.certificationRequestInfo || {}),
new asn1js.Sequence({
name: (names.signatureAlgorithm || "signatureAlgorithm"),
value: [
new asn1js.ObjectIdentifier(),
new asn1js.Any({ optional: true })
]
}),
new asn1js.BitString({ name: (names.signatureValue || "signatureValue") })
]
}));
}
//**********************************************************************************
static schema(parameters = {})
{
/**
* @type {Object}
* @property {string} [blockName]
* @property {string} [saltPrimitive]
* @property {string} [saltConstructed]
* @property {string} [iterationCount]
* @property {string} [keyLength]
* @property {string} [prf]
*/
const names = getParametersValue(parameters, "names", {});
return (new asn1js.Sequence({
name: (names.blockName || ""),
value: [
new asn1js.Choice({
value: [
new asn1js.OctetString({ name: (names.saltPrimitive || "") }),
AlgorithmIdentifier.schema(names.saltConstructed || {})
]
}),
new asn1js.Integer({ name: (names.iterationCount || "") }),
new asn1js.Integer({
name: (names.keyLength || ""),
optional: true
}),
AlgorithmIdentifier.schema(names.prf || {
names: {
optional: true