File size: 2,300 Bytes
2a1c46d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"use strict";
var UnprotectedAttributes_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EnvelopedData = exports.UnprotectedAttributes = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const types_1 = require("./types");
const attribute_1 = require("./attribute");
const recipient_infos_1 = require("./recipient_infos");
const originator_info_1 = require("./originator_info");
const encrypted_content_info_1 = require("./encrypted_content_info");
let UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends asn1_schema_1.AsnArray {
    constructor(items) {
        super(items);
        Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype);
    }
};
exports.UnprotectedAttributes = UnprotectedAttributes;
exports.UnprotectedAttributes = UnprotectedAttributes = UnprotectedAttributes_1 = tslib_1.__decorate([
    (0, asn1_schema_1.AsnType)({
        type: asn1_schema_1.AsnTypeTypes.Set, itemType: attribute_1.Attribute,
    })
], UnprotectedAttributes);
class EnvelopedData {
    version = types_1.CMSVersion.v0;
    originatorInfo;
    recipientInfos = new recipient_infos_1.RecipientInfos();
    encryptedContentInfo = new encrypted_content_info_1.EncryptedContentInfo();
    unprotectedAttrs;
    constructor(params = {}) {
        Object.assign(this, params);
    }
}
exports.EnvelopedData = EnvelopedData;
tslib_1.__decorate([
    (0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
], EnvelopedData.prototype, "version", void 0);
tslib_1.__decorate([
    (0, asn1_schema_1.AsnProp)({
        type: originator_info_1.OriginatorInfo, context: 0, implicit: true, optional: true,
    })
], EnvelopedData.prototype, "originatorInfo", void 0);
tslib_1.__decorate([
    (0, asn1_schema_1.AsnProp)({ type: recipient_infos_1.RecipientInfos })
], EnvelopedData.prototype, "recipientInfos", void 0);
tslib_1.__decorate([
    (0, asn1_schema_1.AsnProp)({ type: encrypted_content_info_1.EncryptedContentInfo })
], EnvelopedData.prototype, "encryptedContentInfo", void 0);
tslib_1.__decorate([
    (0, asn1_schema_1.AsnProp)({
        type: UnprotectedAttributes, context: 1, implicit: true, optional: true,
    })
], EnvelopedData.prototype, "unprotectedAttrs", void 0);