@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
166 lines (165 loc) • 5.16 kB
TypeScript
import { ASN1Element as _Element, OPTIONAL } from "asn1-ts";
import * as $ from "asn1-ts/dist/node/functional";
import { CertificateRevocationLists } from "../PKCS7/CertificateRevocationLists.ta";
import { CertificateSet } from "../PKCS7/CertificateSet.ta";
import { ContentInfo } from "../PKCS7/ContentInfo.ta";
import { DigestAlgorithmIdentifiers } from "../PKCS7/DigestAlgorithmIdentifiers.ta";
import { SignerInfos } from "../PKCS7/SignerInfos.ta";
import { Version } from "../PKCS7/Version.ta";
export { CertificateRevocationLists, _decode_CertificateRevocationLists, _encode_CertificateRevocationLists, } from "../PKCS7/CertificateRevocationLists.ta";
export { CertificateSet, _decode_CertificateSet, _encode_CertificateSet, } from "../PKCS7/CertificateSet.ta";
export { ContentInfo, _decode_ContentInfo, _encode_ContentInfo, } from "../PKCS7/ContentInfo.ta";
export { DigestAlgorithmIdentifiers, _decode_DigestAlgorithmIdentifiers, _encode_DigestAlgorithmIdentifiers, } from "../PKCS7/DigestAlgorithmIdentifiers.ta";
export { SignerInfos, _decode_SignerInfos, _encode_SignerInfos, } from "../PKCS7/SignerInfos.ta";
export { Version, _decode_Version, _encode_Version } from "../PKCS7/Version.ta";
/**
* @summary SignedData
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* SignedData ::= SEQUENCE {
* version Version,
* digestAlgorithms DigestAlgorithmIdentifiers,
* contentInfo ContentInfo,
* certificates [0] CertificateSet OPTIONAL,
* crls [1] CertificateRevocationLists OPTIONAL,
* signerInfos SignerInfos
* }
* ```
*
* @class
*/
export declare class SignedData {
/**
* @summary `version`.
* @public
* @readonly
*/
readonly version: Version;
/**
* @summary `digestAlgorithms`.
* @public
* @readonly
*/
readonly digestAlgorithms: DigestAlgorithmIdentifiers;
/**
* @summary `contentInfo`.
* @public
* @readonly
*/
readonly contentInfo: ContentInfo;
/**
* @summary `certificates`.
* @public
* @readonly
*/
readonly certificates: OPTIONAL<CertificateSet>;
/**
* @summary `crls`.
* @public
* @readonly
*/
readonly crls: OPTIONAL<CertificateRevocationLists>;
/**
* @summary `signerInfos`.
* @public
* @readonly
*/
readonly signerInfos: SignerInfos;
constructor(
/**
* @summary `version`.
* @public
* @readonly
*/
version: Version,
/**
* @summary `digestAlgorithms`.
* @public
* @readonly
*/
digestAlgorithms: DigestAlgorithmIdentifiers,
/**
* @summary `contentInfo`.
* @public
* @readonly
*/
contentInfo: ContentInfo,
/**
* @summary `certificates`.
* @public
* @readonly
*/
certificates: OPTIONAL<CertificateSet>,
/**
* @summary `crls`.
* @public
* @readonly
*/
crls: OPTIONAL<CertificateRevocationLists>,
/**
* @summary `signerInfos`.
* @public
* @readonly
*/
signerInfos: SignerInfos);
/**
* @summary Restructures an object into a SignedData
* @description
*
* This takes an `object` and converts it to a `SignedData`.
*
* @public
* @static
* @method
* @param {Object} _o An object having all of the keys and values of a `SignedData`.
* @returns {SignedData}
*/
static _from_object(_o: {
[_K in keyof SignedData]: SignedData[_K];
}): SignedData;
}
/**
* @summary The Leading Root Component Types of SignedData
* @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_SignedData: $.ComponentSpec[];
/**
* @summary The Trailing Root Component Types of SignedData
* @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_SignedData: $.ComponentSpec[];
/**
* @summary The Extension Addition Component Types of SignedData
* @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_SignedData: $.ComponentSpec[];
/**
* @summary Decodes an ASN.1 element into a(n) SignedData
* @function
* @param {_Element} el The element being decoded.
* @returns {SignedData} The decoded data structure.
*/
export declare function _decode_SignedData(el: _Element): SignedData;
/**
* @summary Encodes a(n) SignedData 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 SignedData, encoded as an ASN.1 Element.
*/
export declare function _encode_SignedData(value: SignedData, elGetter: $.ASN1Encoder<SignedData>): _Element;