first commit

This commit is contained in:
Stefan Hacker
2026-04-03 09:38:48 +02:00
commit 37ad745546
47450 changed files with 3120798 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
export class Attribute {
constructor(params = {}) {
this.attrType = "";
this.attrValues = [];
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], Attribute.prototype, "attrType", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, repeated: "set" })
], Attribute.prototype, "attrValues", void 0);
@@ -0,0 +1,10 @@
import { __decorate } from "tslib";
import { AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { SignerInfo } from "../signer_info";
export const id_counterSignature = "1.2.840.113549.1.9.6";
let CounterSignature = class CounterSignature extends SignerInfo {
};
CounterSignature = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], CounterSignature);
export { CounterSignature };
+4
View File
@@ -0,0 +1,4 @@
export * from "./counter_signature";
export * from "./message_digest";
export * from "./signing_time";
export const id_contentType = "1.2.840.113549.1.9.3";
@@ -0,0 +1,4 @@
import { OctetString } from "@peculiar/asn1-schema";
export const id_messageDigest = "1.2.840.113549.1.9.4";
export class MessageDigest extends OctetString {
}
@@ -0,0 +1,10 @@
import { __decorate } from "tslib";
import { Time } from "@peculiar/asn1-x509";
import { AsnTypeTypes, AsnType } from "@peculiar/asn1-schema";
export const id_signingTime = "1.2.840.113549.1.9.5";
let SigningTime = class SigningTime extends Time {
};
SigningTime = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], SigningTime);
export { SigningTime };
+46
View File
@@ -0,0 +1,46 @@
var CertificateSet_1;
import { __decorate } from "tslib";
import { AsnType, AsnTypeTypes, AsnProp, AsnPropTypes, AsnArray } from "@peculiar/asn1-schema";
import { Certificate } from "@peculiar/asn1-x509";
import { AttributeCertificate } from "@peculiar/asn1-x509-attr";
export class OtherCertificateFormat {
constructor(params = {}) {
this.otherCertFormat = "";
this.otherCert = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], OtherCertificateFormat.prototype, "otherCertFormat", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any })
], OtherCertificateFormat.prototype, "otherCert", void 0);
let CertificateChoices = class CertificateChoices {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: Certificate })
], CertificateChoices.prototype, "certificate", void 0);
__decorate([
AsnProp({ type: AttributeCertificate, context: 2, implicit: true })
], CertificateChoices.prototype, "v2AttrCert", void 0);
__decorate([
AsnProp({ type: OtherCertificateFormat, context: 3, implicit: true })
], CertificateChoices.prototype, "other", void 0);
CertificateChoices = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], CertificateChoices);
export { CertificateChoices };
let CertificateSet = CertificateSet_1 = class CertificateSet extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, CertificateSet_1.prototype);
}
};
CertificateSet = CertificateSet_1 = __decorate([
AsnType({ type: AsnTypeTypes.Set, itemType: CertificateChoices })
], CertificateSet);
export { CertificateSet };
+15
View File
@@ -0,0 +1,15 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
export class ContentInfo {
constructor(params = {}) {
this.contentType = "";
this.content = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], ContentInfo.prototype, "contentType", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, context: 0 })
], ContentInfo.prototype, "content", void 0);
@@ -0,0 +1,29 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, OctetString } from "@peculiar/asn1-schema";
let EncapsulatedContent = class EncapsulatedContent {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: OctetString })
], EncapsulatedContent.prototype, "single", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any })
], EncapsulatedContent.prototype, "any", void 0);
EncapsulatedContent = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], EncapsulatedContent);
export { EncapsulatedContent };
export class EncapsulatedContentInfo {
constructor(params = {}) {
this.eContentType = "";
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], EncapsulatedContentInfo.prototype, "eContentType", void 0);
__decorate([
AsnProp({ type: EncapsulatedContent, context: 0, optional: true })
], EncapsulatedContentInfo.prototype, "eContent", void 0);
+41
View File
@@ -0,0 +1,41 @@
import { __decorate } from "tslib";
import { AsnConstructedOctetStringConverter, AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, OctetString, } from "@peculiar/asn1-schema";
import { ContentEncryptionAlgorithmIdentifier } from "./types";
let EncryptedContent = class EncryptedContent {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: OctetString, context: 0, implicit: true, optional: true })
], EncryptedContent.prototype, "value", void 0);
__decorate([
AsnProp({
type: OctetString,
converter: AsnConstructedOctetStringConverter,
context: 0,
implicit: true,
optional: true,
repeated: "sequence",
})
], EncryptedContent.prototype, "constructedValue", void 0);
EncryptedContent = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], EncryptedContent);
export { EncryptedContent };
export class EncryptedContentInfo {
constructor(params = {}) {
this.contentType = "";
this.contentEncryptionAlgorithm = new ContentEncryptionAlgorithmIdentifier();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], EncryptedContentInfo.prototype, "contentType", void 0);
__decorate([
AsnProp({ type: ContentEncryptionAlgorithmIdentifier })
], EncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0);
__decorate([
AsnProp({ type: EncryptedContent, optional: true })
], EncryptedContentInfo.prototype, "encryptedContent", void 0);
+41
View File
@@ -0,0 +1,41 @@
var UnprotectedAttributes_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { CMSVersion } from "./types";
import { Attribute } from "./attribute";
import { RecipientInfos } from "./recipient_infos";
import { OriginatorInfo } from "./originator_info";
import { EncryptedContentInfo } from "./encrypted_content_info";
let UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype);
}
};
UnprotectedAttributes = UnprotectedAttributes_1 = __decorate([
AsnType({ type: AsnTypeTypes.Set, itemType: Attribute })
], UnprotectedAttributes);
export { UnprotectedAttributes };
export class EnvelopedData {
constructor(params = {}) {
this.version = CMSVersion.v0;
this.recipientInfos = new RecipientInfos();
this.encryptedContentInfo = new EncryptedContentInfo();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], EnvelopedData.prototype, "version", void 0);
__decorate([
AsnProp({ type: OriginatorInfo, context: 0, implicit: true, optional: true })
], EnvelopedData.prototype, "originatorInfo", void 0);
__decorate([
AsnProp({ type: RecipientInfos })
], EnvelopedData.prototype, "recipientInfos", void 0);
__decorate([
AsnProp({ type: EncryptedContentInfo })
], EnvelopedData.prototype, "encryptedContentInfo", void 0);
__decorate([
AsnProp({ type: UnprotectedAttributes, context: 1, implicit: true, optional: true })
], EnvelopedData.prototype, "unprotectedAttrs", void 0);
+21
View File
@@ -0,0 +1,21 @@
export * from "./attributes";
export * from "./attribute";
export * from "./certificate_choices";
export * from "./content_info";
export * from "./encapsulated_content_info";
export * from "./encrypted_content_info";
export * from "./enveloped_data";
export * from "./issuer_and_serial_number";
export * from "./kek_recipient_info";
export * from "./key_agree_recipient_info";
export * from "./key_trans_recipient_info";
export * from "./object_identifiers";
export * from "./originator_info";
export * from "./password_recipient_info";
export * from "./recipient_info";
export * from "./recipient_infos";
export * from "./revocation_info_choice";
export * from "./signed_data";
export * from "./signer_identifier";
export * from "./signer_info";
export * from "./types";
@@ -0,0 +1,16 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnIntegerArrayBufferConverter } from "@peculiar/asn1-schema";
import { Name } from "@peculiar/asn1-x509";
export class IssuerAndSerialNumber {
constructor(params = {}) {
this.issuer = new Name();
this.serialNumber = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: Name })
], IssuerAndSerialNumber.prototype, "issuer", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
], IssuerAndSerialNumber.prototype, "serialNumber", void 0);
+40
View File
@@ -0,0 +1,40 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, OctetString } from "@peculiar/asn1-schema";
import { OtherKeyAttribute } from "./other_key_attribute";
import { CMSVersion, KeyEncryptionAlgorithmIdentifier } from "./types";
export class KEKIdentifier {
constructor(params = {}) {
this.keyIdentifier = new OctetString();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: OctetString })
], KEKIdentifier.prototype, "keyIdentifier", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.GeneralizedTime, optional: true })
], KEKIdentifier.prototype, "date", void 0);
__decorate([
AsnProp({ type: OtherKeyAttribute, optional: true })
], KEKIdentifier.prototype, "other", void 0);
export class KEKRecipientInfo {
constructor(params = {}) {
this.version = CMSVersion.v4;
this.kekid = new KEKIdentifier();
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
this.encryptedKey = new OctetString();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], KEKRecipientInfo.prototype, "version", void 0);
__decorate([
AsnProp({ type: KEKIdentifier })
], KEKRecipientInfo.prototype, "kekid", void 0);
__decorate([
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
__decorate([
AsnProp({ type: OctetString })
], KEKRecipientInfo.prototype, "encryptedKey", void 0);
@@ -0,0 +1,115 @@
var RecipientEncryptedKeys_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString, } from "@peculiar/asn1-schema";
import { CMSVersion, KeyEncryptionAlgorithmIdentifier } from "./types";
import { IssuerAndSerialNumber } from "./issuer_and_serial_number";
import { AlgorithmIdentifier, SubjectKeyIdentifier } from "@peculiar/asn1-x509";
import { OtherKeyAttribute } from "./other_key_attribute";
export class RecipientKeyIdentifier {
constructor(params = {}) {
this.subjectKeyIdentifier = new SubjectKeyIdentifier();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: SubjectKeyIdentifier })
], RecipientKeyIdentifier.prototype, "subjectKeyIdentifier", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.GeneralizedTime, optional: true })
], RecipientKeyIdentifier.prototype, "date", void 0);
__decorate([
AsnProp({ type: OtherKeyAttribute, optional: true })
], RecipientKeyIdentifier.prototype, "other", void 0);
let KeyAgreeRecipientIdentifier = class KeyAgreeRecipientIdentifier {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: RecipientKeyIdentifier, context: 0, implicit: true, optional: true })
], KeyAgreeRecipientIdentifier.prototype, "rKeyId", void 0);
__decorate([
AsnProp({ type: IssuerAndSerialNumber, optional: true })
], KeyAgreeRecipientIdentifier.prototype, "issuerAndSerialNumber", void 0);
KeyAgreeRecipientIdentifier = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], KeyAgreeRecipientIdentifier);
export { KeyAgreeRecipientIdentifier };
export class RecipientEncryptedKey {
constructor(params = {}) {
this.rid = new KeyAgreeRecipientIdentifier();
this.encryptedKey = new OctetString();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: KeyAgreeRecipientIdentifier })
], RecipientEncryptedKey.prototype, "rid", void 0);
__decorate([
AsnProp({ type: OctetString })
], RecipientEncryptedKey.prototype, "encryptedKey", void 0);
let RecipientEncryptedKeys = RecipientEncryptedKeys_1 = class RecipientEncryptedKeys extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, RecipientEncryptedKeys_1.prototype);
}
};
RecipientEncryptedKeys = RecipientEncryptedKeys_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: RecipientEncryptedKey })
], RecipientEncryptedKeys);
export { RecipientEncryptedKeys };
export class OriginatorPublicKey {
constructor(params = {}) {
this.algorithm = new AlgorithmIdentifier();
this.publicKey = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AlgorithmIdentifier })
], OriginatorPublicKey.prototype, "algorithm", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.BitString })
], OriginatorPublicKey.prototype, "publicKey", void 0);
let OriginatorIdentifierOrKey = class OriginatorIdentifierOrKey {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true, optional: true })
], OriginatorIdentifierOrKey.prototype, "subjectKeyIdentifier", void 0);
__decorate([
AsnProp({ type: OriginatorPublicKey, context: 1, implicit: true, optional: true })
], OriginatorIdentifierOrKey.prototype, "originatorKey", void 0);
__decorate([
AsnProp({ type: IssuerAndSerialNumber, optional: true })
], OriginatorIdentifierOrKey.prototype, "issuerAndSerialNumber", void 0);
OriginatorIdentifierOrKey = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], OriginatorIdentifierOrKey);
export { OriginatorIdentifierOrKey };
export class KeyAgreeRecipientInfo {
constructor(params = {}) {
this.version = CMSVersion.v3;
this.originator = new OriginatorIdentifierOrKey();
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
this.recipientEncryptedKeys = new RecipientEncryptedKeys();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], KeyAgreeRecipientInfo.prototype, "version", void 0);
__decorate([
AsnProp({ type: OriginatorIdentifierOrKey, context: 0 })
], KeyAgreeRecipientInfo.prototype, "originator", void 0);
__decorate([
AsnProp({ type: OctetString, context: 1, optional: true })
], KeyAgreeRecipientInfo.prototype, "ukm", void 0);
__decorate([
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
], KeyAgreeRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
__decorate([
AsnProp({ type: RecipientEncryptedKeys })
], KeyAgreeRecipientInfo.prototype, "recipientEncryptedKeys", void 0);
@@ -0,0 +1,41 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, OctetString } from "@peculiar/asn1-schema";
import { CMSVersion, KeyEncryptionAlgorithmIdentifier } from "./types";
import { IssuerAndSerialNumber } from "./issuer_and_serial_number";
import { SubjectKeyIdentifier } from "@peculiar/asn1-x509";
let RecipientIdentifier = class RecipientIdentifier {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true })
], RecipientIdentifier.prototype, "subjectKeyIdentifier", void 0);
__decorate([
AsnProp({ type: IssuerAndSerialNumber })
], RecipientIdentifier.prototype, "issuerAndSerialNumber", void 0);
RecipientIdentifier = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], RecipientIdentifier);
export { RecipientIdentifier };
export class KeyTransRecipientInfo {
constructor(params = {}) {
this.version = CMSVersion.v0;
this.rid = new RecipientIdentifier();
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
this.encryptedKey = new OctetString();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], KeyTransRecipientInfo.prototype, "version", void 0);
__decorate([
AsnProp({ type: RecipientIdentifier })
], KeyTransRecipientInfo.prototype, "rid", void 0);
__decorate([
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
], KeyTransRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
__decorate([
AsnProp({ type: OctetString })
], KeyTransRecipientInfo.prototype, "encryptedKey", void 0);
+7
View File
@@ -0,0 +1,7 @@
export const id_ct_contentInfo = "1.2.840.113549.1.9.16.1.6";
export const id_data = "1.2.840.113549.1.7.1";
export const id_signedData = "1.2.840.113549.1.7.2";
export const id_envelopedData = "1.2.840.113549.1.7.3";
export const id_digestedData = "1.2.840.113549.1.7.5";
export const id_encryptedData = "1.2.840.113549.1.7.6";
export const id_authData = "1.2.840.113549.1.9.16.1.2";
+15
View File
@@ -0,0 +1,15 @@
import { __decorate } from "tslib";
import { AsnProp } from "@peculiar/asn1-schema";
import { CertificateSet } from "./certificate_choices";
import { RevocationInfoChoices } from "./revocation_info_choice";
export class OriginatorInfo {
constructor(params = {}) {
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: CertificateSet, context: 0, implicit: true, optional: true })
], OriginatorInfo.prototype, "certs", void 0);
__decorate([
AsnProp({ type: RevocationInfoChoices, context: 1, implicit: true, optional: true })
], OriginatorInfo.prototype, "crls", void 0);
+14
View File
@@ -0,0 +1,14 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
export class OtherKeyAttribute {
constructor(params = {}) {
this.keyAttrId = "";
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], OtherKeyAttribute.prototype, "keyAttrId", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, optional: true })
], OtherKeyAttribute.prototype, "keyAttr", void 0);
@@ -0,0 +1,23 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, OctetString } from "@peculiar/asn1-schema";
import { CMSVersion, KeyDerivationAlgorithmIdentifier, KeyEncryptionAlgorithmIdentifier, } from "./types";
export class PasswordRecipientInfo {
constructor(params = {}) {
this.version = CMSVersion.v0;
this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
this.encryptedKey = new OctetString();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], PasswordRecipientInfo.prototype, "version", void 0);
__decorate([
AsnProp({ type: KeyDerivationAlgorithmIdentifier, context: 0, optional: true })
], PasswordRecipientInfo.prototype, "keyDerivationAlgorithm", void 0);
__decorate([
AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
], PasswordRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
__decorate([
AsnProp({ type: OctetString })
], PasswordRecipientInfo.prototype, "encryptedKey", void 0);
+43
View File
@@ -0,0 +1,43 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { KeyAgreeRecipientInfo } from "./key_agree_recipient_info";
import { KeyTransRecipientInfo } from "./key_trans_recipient_info";
import { KEKRecipientInfo } from "./kek_recipient_info";
import { PasswordRecipientInfo } from "./password_recipient_info";
export class OtherRecipientInfo {
constructor(params = {}) {
this.oriType = "";
this.oriValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], OtherRecipientInfo.prototype, "oriType", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any })
], OtherRecipientInfo.prototype, "oriValue", void 0);
let RecipientInfo = class RecipientInfo {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: KeyTransRecipientInfo, optional: true })
], RecipientInfo.prototype, "ktri", void 0);
__decorate([
AsnProp({ type: KeyAgreeRecipientInfo, context: 1, implicit: true, optional: true })
], RecipientInfo.prototype, "kari", void 0);
__decorate([
AsnProp({ type: KEKRecipientInfo, context: 2, implicit: true, optional: true })
], RecipientInfo.prototype, "kekri", void 0);
__decorate([
AsnProp({ type: PasswordRecipientInfo, context: 3, implicit: true, optional: true })
], RecipientInfo.prototype, "pwri", void 0);
__decorate([
AsnProp({ type: OtherRecipientInfo, context: 4, implicit: true, optional: true })
], RecipientInfo.prototype, "ori", void 0);
RecipientInfo = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], RecipientInfo);
export { RecipientInfo };
+14
View File
@@ -0,0 +1,14 @@
var RecipientInfos_1;
import { __decorate } from "tslib";
import { AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { RecipientInfo } from "./recipient_info";
let RecipientInfos = RecipientInfos_1 = class RecipientInfos extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, RecipientInfos_1.prototype);
}
};
RecipientInfos = RecipientInfos_1 = __decorate([
AsnType({ type: AsnTypeTypes.Set, itemType: RecipientInfo })
], RecipientInfos);
export { RecipientInfos };
+43
View File
@@ -0,0 +1,43 @@
var RevocationInfoChoices_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnType, AsnTypeTypes, AsnArray } from "@peculiar/asn1-schema";
import { id_pkix } from "@peculiar/asn1-x509";
export const id_ri = `${id_pkix}.16`;
export const id_ri_ocsp_response = `${id_ri}.2`;
export const id_ri_scvp = `${id_ri}.4`;
export class OtherRevocationInfoFormat {
constructor(params = {}) {
this.otherRevInfoFormat = "";
this.otherRevInfo = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], OtherRevocationInfoFormat.prototype, "otherRevInfoFormat", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any })
], OtherRevocationInfoFormat.prototype, "otherRevInfo", void 0);
let RevocationInfoChoice = class RevocationInfoChoice {
constructor(params = {}) {
this.other = new OtherRevocationInfoFormat();
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: OtherRevocationInfoFormat, context: 1, implicit: true })
], RevocationInfoChoice.prototype, "other", void 0);
RevocationInfoChoice = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], RevocationInfoChoice);
export { RevocationInfoChoice };
let RevocationInfoChoices = RevocationInfoChoices_1 = class RevocationInfoChoices extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, RevocationInfoChoices_1.prototype);
}
};
RevocationInfoChoices = RevocationInfoChoices_1 = __decorate([
AsnType({ type: AsnTypeTypes.Set, itemType: RevocationInfoChoice })
], RevocationInfoChoices);
export { RevocationInfoChoices };
+45
View File
@@ -0,0 +1,45 @@
var DigestAlgorithmIdentifiers_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { CertificateSet } from "./certificate_choices";
import { CMSVersion, DigestAlgorithmIdentifier } from "./types";
import { EncapsulatedContentInfo } from "./encapsulated_content_info";
import { RevocationInfoChoices } from "./revocation_info_choice";
import { SignerInfos } from "./signer_info";
let DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = class DigestAlgorithmIdentifiers extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, DigestAlgorithmIdentifiers_1.prototype);
}
};
DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = __decorate([
AsnType({ type: AsnTypeTypes.Set, itemType: DigestAlgorithmIdentifier })
], DigestAlgorithmIdentifiers);
export { DigestAlgorithmIdentifiers };
export class SignedData {
constructor(params = {}) {
this.version = CMSVersion.v0;
this.digestAlgorithms = new DigestAlgorithmIdentifiers();
this.encapContentInfo = new EncapsulatedContentInfo();
this.signerInfos = new SignerInfos();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], SignedData.prototype, "version", void 0);
__decorate([
AsnProp({ type: DigestAlgorithmIdentifiers })
], SignedData.prototype, "digestAlgorithms", void 0);
__decorate([
AsnProp({ type: EncapsulatedContentInfo })
], SignedData.prototype, "encapContentInfo", void 0);
__decorate([
AsnProp({ type: CertificateSet, context: 0, implicit: true, optional: true })
], SignedData.prototype, "certificates", void 0);
__decorate([
AsnProp({ type: RevocationInfoChoices, context: 1, implicit: true, optional: true })
], SignedData.prototype, "crls", void 0);
__decorate([
AsnProp({ type: SignerInfos })
], SignedData.prototype, "signerInfos", void 0);
+19
View File
@@ -0,0 +1,19 @@
import { __decorate } from "tslib";
import { AsnProp, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { IssuerAndSerialNumber } from "./issuer_and_serial_number";
import { SubjectKeyIdentifier } from "@peculiar/asn1-x509";
let SignerIdentifier = class SignerIdentifier {
constructor(params = {}) {
Object.assign(this, params);
}
};
__decorate([
AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true })
], SignerIdentifier.prototype, "subjectKeyIdentifier", void 0);
__decorate([
AsnProp({ type: IssuerAndSerialNumber })
], SignerIdentifier.prototype, "issuerAndSerialNumber", void 0);
SignerIdentifier = __decorate([
AsnType({ type: AsnTypeTypes.Choice })
], SignerIdentifier);
export { SignerIdentifier };
+54
View File
@@ -0,0 +1,54 @@
var SignerInfos_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString, } from "@peculiar/asn1-schema";
import { SignerIdentifier } from "./signer_identifier";
import { CMSVersion, SignatureAlgorithmIdentifier, DigestAlgorithmIdentifier } from "./types";
import { Attribute } from "./attribute";
export class SignerInfo {
constructor(params = {}) {
this.version = CMSVersion.v0;
this.sid = new SignerIdentifier();
this.digestAlgorithm = new DigestAlgorithmIdentifier();
this.signatureAlgorithm = new SignatureAlgorithmIdentifier();
this.signature = new OctetString();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], SignerInfo.prototype, "version", void 0);
__decorate([
AsnProp({ type: SignerIdentifier })
], SignerInfo.prototype, "sid", void 0);
__decorate([
AsnProp({ type: DigestAlgorithmIdentifier })
], SignerInfo.prototype, "digestAlgorithm", void 0);
__decorate([
AsnProp({
type: Attribute,
repeated: "set",
context: 0,
implicit: true,
optional: true,
raw: true,
})
], SignerInfo.prototype, "signedAttrs", void 0);
__decorate([
AsnProp({ type: SignatureAlgorithmIdentifier })
], SignerInfo.prototype, "signatureAlgorithm", void 0);
__decorate([
AsnProp({ type: OctetString })
], SignerInfo.prototype, "signature", void 0);
__decorate([
AsnProp({ type: Attribute, repeated: "set", context: 1, implicit: true, optional: true })
], SignerInfo.prototype, "unsignedAttrs", void 0);
let SignerInfos = SignerInfos_1 = class SignerInfos extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, SignerInfos_1.prototype);
}
};
SignerInfos = SignerInfos_1 = __decorate([
AsnType({ type: AsnTypeTypes.Set, itemType: SignerInfo })
], SignerInfos);
export { SignerInfos };
+48
View File
@@ -0,0 +1,48 @@
import { __decorate } from "tslib";
import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
import { AsnTypeTypes, AsnType } from "@peculiar/asn1-schema";
export var CMSVersion;
(function (CMSVersion) {
CMSVersion[CMSVersion["v0"] = 0] = "v0";
CMSVersion[CMSVersion["v1"] = 1] = "v1";
CMSVersion[CMSVersion["v2"] = 2] = "v2";
CMSVersion[CMSVersion["v3"] = 3] = "v3";
CMSVersion[CMSVersion["v4"] = 4] = "v4";
CMSVersion[CMSVersion["v5"] = 5] = "v5";
})(CMSVersion || (CMSVersion = {}));
let DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends AlgorithmIdentifier {
};
DigestAlgorithmIdentifier = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], DigestAlgorithmIdentifier);
export { DigestAlgorithmIdentifier };
let SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends AlgorithmIdentifier {
};
SignatureAlgorithmIdentifier = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], SignatureAlgorithmIdentifier);
export { SignatureAlgorithmIdentifier };
let KeyEncryptionAlgorithmIdentifier = class KeyEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
};
KeyEncryptionAlgorithmIdentifier = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], KeyEncryptionAlgorithmIdentifier);
export { KeyEncryptionAlgorithmIdentifier };
let ContentEncryptionAlgorithmIdentifier = class ContentEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
};
ContentEncryptionAlgorithmIdentifier = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], ContentEncryptionAlgorithmIdentifier);
export { ContentEncryptionAlgorithmIdentifier };
let MessageAuthenticationCodeAlgorithm = class MessageAuthenticationCodeAlgorithm extends AlgorithmIdentifier {
};
MessageAuthenticationCodeAlgorithm = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], MessageAuthenticationCodeAlgorithm);
export { MessageAuthenticationCodeAlgorithm };
let KeyDerivationAlgorithmIdentifier = class KeyDerivationAlgorithmIdentifier extends AlgorithmIdentifier {
};
KeyDerivationAlgorithmIdentifier = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], KeyDerivationAlgorithmIdentifier);
export { KeyDerivationAlgorithmIdentifier };