@wildboar/pki-stub
Version:
X.510 PKI-Stub ASN.1 data structures in TypeScript
35 lines (34 loc) • 1.21 kB
TypeScript
import { ASN1Element as _Element, NumericString, PrintableString } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
/**
* @summary CountryName
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* CountryName ::= [APPLICATION 1] CHOICE {
* x121-dcc-code NumericString(SIZE (ub-country-name-numeric-length)),
* iso-3166-alpha2-code PrintableString(SIZE (ub-country-name-alpha-length)) }
* ```
*/
export declare type CountryName = {
x121_dcc_code: NumericString;
} | {
iso_3166_alpha2_code: PrintableString;
};
/**
* @summary Decodes an ASN.1 element into a(n) CountryName
* @function
* @param {_Element} el The element being decoded.
* @returns {CountryName} The decoded data structure.
*/
export declare function _decode_CountryName(el: _Element): CountryName;
/**
* @summary Encodes a(n) CountryName 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 CountryName, encoded as an ASN.1 Element.
*/
export declare function _encode_CountryName(value: CountryName, elGetter: $.ASN1Encoder<CountryName>): _Element;