@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
227 lines (226 loc) • 6.79 kB
TypeScript
import { ASN1Element as _Element, GeneralizedTime, INTEGER, OCTET_STRING, OPTIONAL } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
import { Path } from "../PKCS-15/Path.ta";
import { PinFlags } from "../PKCS-15/PinFlags.ta";
import { PinType, _enum_for_PinType } from "../PKCS-15/PinType.ta";
import { Reference } from "../PKCS-15/Reference.ta";
export { Path, _decode_Path, _encode_Path } from "../PKCS-15/Path.ta";
export { case_sensitive, change_disabled, confidentiality_protected, disable_allowed, exchangeRefData, initialized, integrity_protected, local, needs_padding, PinFlags, PinFlags_case_sensitive, PinFlags_change_disabled, PinFlags_confidentiality_protected, PinFlags_disable_allowed, PinFlags_exchangeRefData, PinFlags_initialized, PinFlags_integrity_protected, PinFlags_local, PinFlags_needs_padding, PinFlags_soPin, PinFlags_unblockingPin, PinFlags_unblock_disabled, soPin, unblockingPin, unblock_disabled, _decode_PinFlags, _encode_PinFlags, } from "../PKCS-15/PinFlags.ta";
export { ascii_numeric, bcd, half_nibble_bcd, iso9564_1, PinType, PinType_ascii_numeric, PinType_bcd, PinType_half_nibble_bcd, PinType_iso9564_1, PinType_utf8, utf8, _decode_PinType, _encode_PinType, _enum_for_PinType, } from "../PKCS-15/PinType.ta";
export { Reference, _decode_Reference, _encode_Reference, } from "../PKCS-15/Reference.ta";
/**
* @summary PinAttributes
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* PinAttributes ::= SEQUENCE {
* pinFlags PinFlags,
* pinType PinType,
* minLength INTEGER (pkcs15-lb-minPinLength..pkcs15-ub-minPinLength),
* storedLength INTEGER (0..pkcs15-ub-storedPinLength),
* maxLength INTEGER OPTIONAL,
* pinReference [0] Reference DEFAULT 0,
* padChar OCTET STRING (SIZE(1)) OPTIONAL,
* lastPinChange GeneralizedTime OPTIONAL,
* path Path OPTIONAL,
* ... -- For future extensions
* }
* ```
*
* @class
*/
export declare class PinAttributes {
/**
* @summary `pinFlags`.
* @public
* @readonly
*/
readonly pinFlags: PinFlags;
/**
* @summary `pinType`.
* @public
* @readonly
*/
readonly pinType: PinType;
/**
* @summary `minLength`.
* @public
* @readonly
*/
readonly minLength: INTEGER;
/**
* @summary `storedLength`.
* @public
* @readonly
*/
readonly storedLength: INTEGER;
/**
* @summary `maxLength`.
* @public
* @readonly
*/
readonly maxLength: OPTIONAL<INTEGER>;
/**
* @summary `pinReference`.
* @public
* @readonly
*/
readonly pinReference: OPTIONAL<Reference>;
/**
* @summary `padChar`.
* @public
* @readonly
*/
readonly padChar: OPTIONAL<OCTET_STRING>;
/**
* @summary `lastPinChange`.
* @public
* @readonly
*/
readonly lastPinChange: OPTIONAL<GeneralizedTime>;
/**
* @summary `path`.
* @public
* @readonly
*/
readonly path: OPTIONAL<Path>;
/**
* @summary Extensions that are not recognized.
* @public
* @readonly
*/
readonly _unrecognizedExtensionsList: _Element[];
constructor(
/**
* @summary `pinFlags`.
* @public
* @readonly
*/
pinFlags: PinFlags,
/**
* @summary `pinType`.
* @public
* @readonly
*/
pinType: PinType,
/**
* @summary `minLength`.
* @public
* @readonly
*/
minLength: INTEGER,
/**
* @summary `storedLength`.
* @public
* @readonly
*/
storedLength: INTEGER,
/**
* @summary `maxLength`.
* @public
* @readonly
*/
maxLength: OPTIONAL<INTEGER>,
/**
* @summary `pinReference`.
* @public
* @readonly
*/
pinReference: OPTIONAL<Reference>,
/**
* @summary `padChar`.
* @public
* @readonly
*/
padChar: OPTIONAL<OCTET_STRING>,
/**
* @summary `lastPinChange`.
* @public
* @readonly
*/
lastPinChange: OPTIONAL<GeneralizedTime>,
/**
* @summary `path`.
* @public
* @readonly
*/
path: OPTIONAL<Path>,
/**
* @summary Extensions that are not recognized.
* @public
* @readonly
*/
_unrecognizedExtensionsList?: _Element[]);
/**
* @summary Restructures an object into a PinAttributes
* @description
*
* This takes an `object` and converts it to a `PinAttributes`.
*
* @public
* @static
* @method
* @param {Object} _o An object having all of the keys and values of a `PinAttributes`.
* @returns {PinAttributes}
*/
static _from_object(_o: {
[_K in keyof PinAttributes]: PinAttributes[_K];
}): PinAttributes;
/**
* @summary Getter that returns the default value for `pinReference`.
* @public
* @static
* @method
*/
static get _default_value_for_pinReference(): number;
/**
* @summary The enum used as the type of the component `pinType`
* @public
* @static
*/
static _enum_for_pinType: typeof _enum_for_PinType;
}
/**
* @summary The Leading Root Component Types of PinAttributes
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the leading root component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _root_component_type_list_1_spec_for_PinAttributes: $.ComponentSpec[];
/**
* @summary The Trailing Root Component Types of PinAttributes
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the trailing root component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _root_component_type_list_2_spec_for_PinAttributes: $.ComponentSpec[];
/**
* @summary The Extension Addition Component Types of PinAttributes
* @description
*
* This is an array of `ComponentSpec`s that define how to decode the extension addition component type list of a SET or SEQUENCE.
*
* @constant
*/
export declare const _extension_additions_list_spec_for_PinAttributes: $.ComponentSpec[];
/**
* @summary Decodes an ASN.1 element into a(n) PinAttributes
* @function
* @param {_Element} el The element being decoded.
* @returns {PinAttributes} The decoded data structure.
*/
export declare function _decode_PinAttributes(el: _Element): PinAttributes;
/**
* @summary Encodes a(n) PinAttributes 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 PinAttributes, encoded as an ASN.1 Element.
*/
export declare function _encode_PinAttributes(value: PinAttributes, elGetter: $.ASN1Encoder<PinAttributes>): _Element;