@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
45 lines (44 loc) • 1.54 kB
TypeScript
import { ASN1Element as _Element } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
import { Identifier } from "../PKCS-15/Identifier.ta";
export { Identifier, _decode_Identifier, _encode_Identifier, } from "../PKCS-15/Identifier.ta";
/**
* @summary SecurityCondition
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* SecurityCondition ::= CHOICE {
* authId Identifier,
* not [0] SecurityCondition,
* and [1] SEQUENCE SIZE (2..pkcs15-ub-securityConditions) OF SecurityCondition,
* or [2] SEQUENCE SIZE (2..pkcs15-ub-securityConditions) OF SecurityCondition,
* ... -- For future extensions
* }
* ```
*/
export declare type SecurityCondition = {
authId: Identifier;
} | {
not: SecurityCondition;
} | {
and: SecurityCondition[];
} | {
or: SecurityCondition[];
} | _Element;
/**
* @summary Decodes an ASN.1 element into a(n) SecurityCondition
* @function
* @param {_Element} el The element being decoded.
* @returns {SecurityCondition} The decoded data structure.
*/
export declare function _decode_SecurityCondition(el: _Element): SecurityCondition;
/**
* @summary Encodes a(n) SecurityCondition into an ASN.1 Element.
* @function
* @param {value} el The element being decoded.
* @param elGetter A function that can be used to get new ASN.1 elements.
* @returns {_Element} The SecurityCondition, encoded as an ASN.1 Element.
*/
export declare function _encode_SecurityCondition(value: SecurityCondition, elGetter: $.ASN1Encoder<SecurityCondition>): _Element;