import * as asn1js from "asn1js"; import * as pvutils from "pvutils"; import { CertificateRevocationList, CertificateRevocationListJson } from "./CertificateRevocationList"; import { EMPTY_STRING } from "./constants"; import { AsnError } from "./errors"; import { OtherRevocationInfoFormat, OtherRevocationInfoFormatJson } from "./OtherRevocationInfoFormat"; import { PkiObject, PkiObjectParameters } from "./PkiObject"; import * as Schema from "./Schema";
export type RevocationInfoChoicesParameters = PkiObjectParameters & Partial<IRevocationInfoChoices>;
export type RevocationInfoChoicesSchema = Schema.SchemaParameters<{
crls?: string;
}>;
/** * Represents the RevocationInfoChoices structure described in [RFC5652](https://datatracker.ietf.org/doc/html/rfc5652)
*/
export class RevocationInfoChoices extends PkiObject implements IRevocationInfoChoices {
public crls!: CertificateRevocationList[]; public otherRevocationInfos!: OtherRevocationInfoFormat[];
/** * Initializes a new instance of the {@link RevocationInfoChoices} class * @param parameters Initialization parameters
*/
constructor(parameters: RevocationInfoChoicesParameters = {}) { super();
if (parameters.schema) { this.fromSchema(parameters.schema);
}
}
/** * Returns default values for all class members * @param memberName String name for a class member * @returns Default value
*/ publicstatic override defaultValues(memberName: typeof CRLS): CertificateRevocationList[]; publicstatic override defaultValues(memberName: typeof OTHER_REVOCATION_INFOS): OtherRevocationInfoFormat[]; publicstatic override defaultValues(memberName: string): any { switch (memberName) { case CRLS: return []; case OTHER_REVOCATION_INFOS: return []; default: returnsuper.defaultValues(memberName);
}
}
// Get internal properties from parsed schema if (asn1.result.crls) { for (const element of asn1.result.crls) { if (element.idBlock.tagClass === 1) this.crls.push(new CertificateRevocationList({ schema: element })); else this.otherRevocationInfos.push(new OtherRevocationInfoFormat({ schema: element }));
}
}
}
public toSchema(): asn1js.Sequence { //#region Create array for output set const outputArray = [];
outputArray.push(...Array.from(this.crls, o => o.toSchema()));
outputArray.push(...Array.from(this.otherRevocationInfos, element => { const schema = element.toSchema();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.