@wildboar/pkcs
Version:
Public Key Cryptography Standard PDUs in TypeScript
191 lines (190 loc) • 6.57 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 { DigestAlgorithmIdentifiers } from "../PKCS7/DigestAlgorithmIdentifiers.ta";
import { EncryptedContentInfo } from "../PKCS7/EncryptedContentInfo.ta";
import { KeyTransportRecipientInfo } from "../PKCS7/KeyTransportRecipientInfo.ta";
import { SignerInfo } from "../PKCS7/SignerInfo.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 { DigestAlgorithmIdentifiers, _decode_DigestAlgorithmIdentifiers, _encode_DigestAlgorithmIdentifiers, } from "../PKCS7/DigestAlgorithmIdentifiers.ta";
export { EncryptedContentInfo, _decode_EncryptedContentInfo, _encode_EncryptedContentInfo, } from "../PKCS7/EncryptedContentInfo.ta";
export { KeyTransportRecipientInfo, _decode_KeyTransportRecipientInfo, _encode_KeyTransportRecipientInfo, } from "../PKCS7/KeyTransportRecipientInfo.ta";
export { SignerInfo, _decode_SignerInfo, _encode_SignerInfo, } from "../PKCS7/SignerInfo.ta";
export { Version, _decode_Version, _encode_Version } from "../PKCS7/Version.ta";
/**
* @summary SignedAndEnvelopedData
* @description
*
* ### ASN.1 Definition:
*
* ```asn1
* SignedAndEnvelopedData ::= SEQUENCE {
* version Version,
* recipientInfos SET SIZE (1..MAX) OF KeyTransportRecipientInfo,
* digestAlgorithms DigestAlgorithmIdentifiers,
* encryptedContentInfo EncryptedContentInfo,
* certificates [0] CertificateSet OPTIONAL,
* crls [1] CertificateRevocationLists OPTIONAL,
* signerInfos
* SET SIZE (1..MAX) OF
* SignerInfo
* (WITH COMPONENTS {
* ...,
* signerIdentifier (WITH COMPONENTS {
* issuerAndSerialNumber PRESENT
* }),
* authenticatedAttributes ABSENT,
* unauthenticatedAttributes ABSENT
* })
* }
* ```
*
* @class
*/
export declare class SignedAndEnvelopedData {
/**
* @summary `version`.
* @public
* @readonly
*/
readonly version: Version;
/**
* @summary `recipientInfos`.
* @public
* @readonly
*/
readonly recipientInfos: KeyTransportRecipientInfo[];
/**
* @summary `digestAlgorithms`.
* @public
* @readonly
*/
readonly digestAlgorithms: DigestAlgorithmIdentifiers;
/**
* @summary `encryptedContentInfo`.
* @public
* @readonly
*/
readonly encryptedContentInfo: EncryptedContentInfo;
/**
* @summary `certificates`.
* @public
* @readonly
*/
readonly certificates: OPTIONAL<CertificateSet>;
/**
* @summary `crls`.
* @public
* @readonly
*/
readonly crls: OPTIONAL<CertificateRevocationLists>;
/**
* @summary `signerInfos`.
* @public
* @readonly
*/
readonly signerInfos: SignerInfo[];
constructor(
/**
* @summary `version`.
* @public
* @readonly
*/
version: Version,
/**
* @summary `recipientInfos`.
* @public
* @readonly
*/
recipientInfos: KeyTransportRecipientInfo[],
/**
* @summary `digestAlgorithms`.
* @public
* @readonly
*/
digestAlgorithms: DigestAlgorithmIdentifiers,
/**
* @summary `encryptedContentInfo`.
* @public
* @readonly
*/
encryptedContentInfo: EncryptedContentInfo,
/**
* @summary `certificates`.
* @public
* @readonly
*/
certificates: OPTIONAL<CertificateSet>,
/**
* @summary `crls`.
* @public
* @readonly
*/
crls: OPTIONAL<CertificateRevocationLists>,
/**
* @summary `signerInfos`.
* @public
* @readonly
*/
signerInfos: SignerInfo[]);
/**
* @summary Restructures an object into a SignedAndEnvelopedData
* @description
*
* This takes an `object` and converts it to a `SignedAndEnvelopedData`.
*
* @public
* @static
* @method
* @param {Object} _o An object having all of the keys and values of a `SignedAndEnvelopedData`.
* @returns {SignedAndEnvelopedData}
*/
static _from_object(_o: {
[_K in keyof SignedAndEnvelopedData]: SignedAndEnvelopedData[_K];
}): SignedAndEnvelopedData;
}
/**
* @summary The Leading Root Component Types of SignedAndEnvelopedData
* @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_SignedAndEnvelopedData: $.ComponentSpec[];
/**
* @summary The Trailing Root Component Types of SignedAndEnvelopedData
* @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_SignedAndEnvelopedData: $.ComponentSpec[];
/**
* @summary The Extension Addition Component Types of SignedAndEnvelopedData
* @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_SignedAndEnvelopedData: $.ComponentSpec[];
/**
* @summary Decodes an ASN.1 element into a(n) SignedAndEnvelopedData
* @function
* @param {_Element} el The element being decoded.
* @returns {SignedAndEnvelopedData} The decoded data structure.
*/
export declare function _decode_SignedAndEnvelopedData(el: _Element): SignedAndEnvelopedData;
/**
* @summary Encodes a(n) SignedAndEnvelopedData 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 SignedAndEnvelopedData, encoded as an ASN.1 Element.
*/
export declare function _encode_SignedAndEnvelopedData(value: SignedAndEnvelopedData, elGetter: $.ASN1Encoder<SignedAndEnvelopedData>): _Element;