@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
128 lines (127 loc) • 4.62 kB
TypeScript
import { ASN1Element as _Element, OPTIONAL } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
import { CommonObjectAttributes } from "../PKCS-15/CommonObjectAttributes.ta";
export { CommonObjectAttributes, _decode_CommonObjectAttributes, _encode_CommonObjectAttributes, } from "../PKCS-15/CommonObjectAttributes.ta";
/**
* @summary PKCS15Object
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* PKCS15Object {ClassAttributes, SubClassAttributes, TypeAttributes} ::= SEQUENCE {
* commonObjectAttributes CommonObjectAttributes,
* classAttributes ClassAttributes,
* subClassAttributes [0] SubClassAttributes OPTIONAL,
* typeAttributes [1] TypeAttributes
* }
* ```
*
* @class
*/
export declare class PKCS15Object<ClassAttributes, SubClassAttributes, TypeAttributes> {
/**
* @summary `commonObjectAttributes`.
* @public
* @readonly
*/
readonly commonObjectAttributes: CommonObjectAttributes;
/**
* @summary `classAttributes`.
* @public
* @readonly
*/
readonly classAttributes: ClassAttributes;
/**
* @summary `subClassAttributes`.
* @public
* @readonly
*/
readonly subClassAttributes: OPTIONAL<SubClassAttributes>;
/**
* @summary `typeAttributes`.
* @public
* @readonly
*/
readonly typeAttributes: TypeAttributes;
constructor(
/**
* @summary `commonObjectAttributes`.
* @public
* @readonly
*/
commonObjectAttributes: CommonObjectAttributes,
/**
* @summary `classAttributes`.
* @public
* @readonly
*/
classAttributes: ClassAttributes,
/**
* @summary `subClassAttributes`.
* @public
* @readonly
*/
subClassAttributes: OPTIONAL<SubClassAttributes>,
/**
* @summary `typeAttributes`.
* @public
* @readonly
*/
typeAttributes: TypeAttributes);
/**
* @summary Restructures an object into a PKCS15Object
* @description
*
* This takes an `object` and converts it to a `PKCS15Object`.
*
* @public
* @static
* @method
* @param {Object} _o An object having all of the keys and values of a `PKCS15Object`.
* @returns {PKCS15Object}
*/
static _from_object(_o: {
[_K in keyof PKCS15Object<any, any, any>]: PKCS15Object<any, any, any>[_K];
}): PKCS15Object<any, any, any>;
}
/**
* @summary The Leading Root Component Types of PKCS15Object
* @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_PKCS15Object: $.ComponentSpec[];
/**
* @summary The Trailing Root Component Types of PKCS15Object
* @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_PKCS15Object: $.ComponentSpec[];
/**
* @summary The Extension Addition Component Types of PKCS15Object
* @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_PKCS15Object: $.ComponentSpec[];
/**
* @summary Returns a function that will decode an ASN.1 element into a(n) PKCS15Object
* @function
* @param {_Element} el The element being decoded.
* @returns A function that will decode an ASN.1 element.
*/
export declare function _get_decoder_for_PKCS15Object<ClassAttributes, SubClassAttributes, TypeAttributes>(_decode_ClassAttributes: $.ASN1Decoder<ClassAttributes>, _decode_SubClassAttributes: $.ASN1Decoder<SubClassAttributes>, _decode_TypeAttributes: $.ASN1Decoder<TypeAttributes>): (el: _Element) => PKCS15Object<ClassAttributes, SubClassAttributes, TypeAttributes>;
/**
* @summary Returns a function that will encode a(n) PKCS15Object into an ASN.1 Element.
* @function
* @returns A function that will encode a(n) PKCS15Object as an ASN.1 element.
*/
export declare function _get_encoder_for_PKCS15Object<ClassAttributes, SubClassAttributes, TypeAttributes>(_encode_ClassAttributes: $.ASN1Encoder<ClassAttributes>, _encode_SubClassAttributes: $.ASN1Encoder<SubClassAttributes>, _encode_TypeAttributes: $.ASN1Encoder<TypeAttributes>): (value: PKCS15Object<ClassAttributes, SubClassAttributes, TypeAttributes>, elGetter: $.ASN1Encoder<PKCS15Object<ClassAttributes, SubClassAttributes, TypeAttributes>>) => _Element;