UNPKG

@wildboar/pkcs

Version:
181 lines (180 loc) 4.95 kB
import { ASN1Element as _Element, INTEGER, OPTIONAL } from "asn1-ts"; import * as $ from "asn1-ts/dist/node/functional"; /** * @summary RSAPrivateKeyObject * @description * * ### ASN.1 Definition: * * ```asn1 * RSAPrivateKeyObject ::= SEQUENCE { * modulus [0] INTEGER OPTIONAL, -- n * publicExponent [1] INTEGER OPTIONAL, -- e * privateExponent [2] INTEGER OPTIONAL, -- d * prime1 [3] INTEGER OPTIONAL, -- p * prime2 [4] INTEGER OPTIONAL, -- q * exponent1 [5] INTEGER OPTIONAL, -- d mod (p-1) * exponent2 [6] INTEGER OPTIONAL, -- d mod (q-1) * coefficient [7] INTEGER OPTIONAL -- inv(q) mod p * } (CONSTRAINED BY {-- must be possible to reconstruct modulus and privateExponent from * -- selected fields --}) * ``` * * @class */ export declare class RSAPrivateKeyObject { /** * @summary `modulus`. * @public * @readonly */ readonly modulus: OPTIONAL<INTEGER>; /** * @summary `publicExponent`. * @public * @readonly */ readonly publicExponent: OPTIONAL<INTEGER>; /** * @summary `privateExponent`. * @public * @readonly */ readonly privateExponent: OPTIONAL<INTEGER>; /** * @summary `prime1`. * @public * @readonly */ readonly prime1: OPTIONAL<INTEGER>; /** * @summary `prime2`. * @public * @readonly */ readonly prime2: OPTIONAL<INTEGER>; /** * @summary `exponent1`. * @public * @readonly */ readonly exponent1: OPTIONAL<INTEGER>; /** * @summary `exponent2`. * @public * @readonly */ readonly exponent2: OPTIONAL<INTEGER>; /** * @summary `coefficient`. * @public * @readonly */ readonly coefficient: OPTIONAL<INTEGER>; constructor( /** * @summary `modulus`. * @public * @readonly */ modulus: OPTIONAL<INTEGER>, /** * @summary `publicExponent`. * @public * @readonly */ publicExponent: OPTIONAL<INTEGER>, /** * @summary `privateExponent`. * @public * @readonly */ privateExponent: OPTIONAL<INTEGER>, /** * @summary `prime1`. * @public * @readonly */ prime1: OPTIONAL<INTEGER>, /** * @summary `prime2`. * @public * @readonly */ prime2: OPTIONAL<INTEGER>, /** * @summary `exponent1`. * @public * @readonly */ exponent1: OPTIONAL<INTEGER>, /** * @summary `exponent2`. * @public * @readonly */ exponent2: OPTIONAL<INTEGER>, /** * @summary `coefficient`. * @public * @readonly */ coefficient: OPTIONAL<INTEGER>); /** * @summary Restructures an object into a RSAPrivateKeyObject * @description * * This takes an `object` and converts it to a `RSAPrivateKeyObject`. * * @public * @static * @method * @param {Object} _o An object having all of the keys and values of a `RSAPrivateKeyObject`. * @returns {RSAPrivateKeyObject} */ static _from_object(_o: { [_K in keyof RSAPrivateKeyObject]: RSAPrivateKeyObject[_K]; }): RSAPrivateKeyObject; } /** * @summary The Leading Root Component Types of RSAPrivateKeyObject * @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_RSAPrivateKeyObject: $.ComponentSpec[]; /** * @summary The Trailing Root Component Types of RSAPrivateKeyObject * @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_RSAPrivateKeyObject: $.ComponentSpec[]; /** * @summary The Extension Addition Component Types of RSAPrivateKeyObject * @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_RSAPrivateKeyObject: $.ComponentSpec[]; /** * @summary Decodes an ASN.1 element into a(n) RSAPrivateKeyObject * @function * @param {_Element} el The element being decoded. * @returns {RSAPrivateKeyObject} The decoded data structure. */ export declare function _decode_RSAPrivateKeyObject(el: _Element): RSAPrivateKeyObject; /** * @summary Encodes a(n) RSAPrivateKeyObject 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 RSAPrivateKeyObject, encoded as an ASN.1 Element. */ export declare function _encode_RSAPrivateKeyObject(value: RSAPrivateKeyObject, elGetter: $.ASN1Encoder<RSAPrivateKeyObject>): _Element;