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
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+8
View File
@@ -0,0 +1,8 @@
# `@peculiar/asn1-pfx`
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/PeculiarVentures/asn1-schema/master/packages/pfx/LICENSE.md)
[![npm version](https://badge.fury.io/js/%40peculiar%2Fasn1-pfx.svg)](https://badge.fury.io/js/%40peculiar%2Fasn1-pfx)
[![NPM](https://nodei.co/npm/@peculiar/asn1-pfx.png)](https://nodei.co/npm/@peculiar/asn1-pfx/)
[RFC 7292](https://tools.ietf.org/html/rfc7292) PKCS #12: Personal Information Exchange Syntax v1.1
+30
View File
@@ -0,0 +1,30 @@
"use strict";
var PKCS12AttrSet_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PKCS12AttrSet = exports.PKCS12Attribute = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
class PKCS12Attribute {
constructor(params = {}) {
this.attrId = "";
this.attrValues = [];
Object.assign(params);
}
}
exports.PKCS12Attribute = PKCS12Attribute;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], PKCS12Attribute.prototype, "attrId", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, repeated: "set" })
], PKCS12Attribute.prototype, "attrValues", void 0);
let PKCS12AttrSet = PKCS12AttrSet_1 = class PKCS12AttrSet extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, PKCS12AttrSet_1.prototype);
}
};
exports.PKCS12AttrSet = PKCS12AttrSet;
exports.PKCS12AttrSet = PKCS12AttrSet = PKCS12AttrSet_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: PKCS12Attribute })
], PKCS12AttrSet);
+17
View File
@@ -0,0 +1,17 @@
"use strict";
var AuthenticatedSafe_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthenticatedSafe = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_cms_1 = require("@peculiar/asn1-cms");
let AuthenticatedSafe = AuthenticatedSafe_1 = class AuthenticatedSafe extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, AuthenticatedSafe_1.prototype);
}
};
exports.AuthenticatedSafe = AuthenticatedSafe;
exports.AuthenticatedSafe = AuthenticatedSafe = AuthenticatedSafe_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: asn1_cms_1.ContentInfo })
], AuthenticatedSafe);
+23
View File
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.id_sdsiCertificate = exports.id_x509Certificate = exports.id_certTypes = exports.CertBag = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const types_1 = require("./types");
class CertBag {
constructor(params = {}) {
this.certId = "";
this.certValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
exports.CertBag = CertBag;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], CertBag.prototype, "certId", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, context: 0 })
], CertBag.prototype, "certValue", void 0);
exports.id_certTypes = `${types_1.id_pkcs_9}.22`;
exports.id_x509Certificate = `${exports.id_certTypes}.1`;
exports.id_sdsiCertificate = `${exports.id_certTypes}.2`;
+22
View File
@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.id_x509CRL = exports.id_crlTypes = exports.CRLBag = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const types_1 = require("./types");
class CRLBag {
constructor(params = {}) {
this.crlId = "";
this.crltValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
exports.CRLBag = CRLBag;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], CRLBag.prototype, "crlId", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, context: 0 })
], CRLBag.prototype, "crltValue", void 0);
exports.id_crlTypes = `${types_1.id_pkcs_9}.23`;
exports.id_x509CRL = `${exports.id_crlTypes}.1`;
+9
View File
@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./cert_bag"), exports);
tslib_1.__exportStar(require("./crl_bag"), exports);
tslib_1.__exportStar(require("./key_bag"), exports);
tslib_1.__exportStar(require("./pkcs8_shrouded_key_bag"), exports);
tslib_1.__exportStar(require("./secret_bag"), exports);
tslib_1.__exportStar(require("./types"), exports);
+12
View File
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.KeyBag = void 0;
const tslib_1 = require("tslib");
const asn1_pkcs8_1 = require("@peculiar/asn1-pkcs8");
const asn1_schema_1 = require("@peculiar/asn1-schema");
let KeyBag = class KeyBag extends asn1_pkcs8_1.PrivateKeyInfo {
};
exports.KeyBag = KeyBag;
exports.KeyBag = KeyBag = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })
], KeyBag);
@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PKCS8ShroudedKeyBag = void 0;
const tslib_1 = require("tslib");
const asn1_pkcs8_1 = require("@peculiar/asn1-pkcs8");
const asn1_schema_1 = require("@peculiar/asn1-schema");
let PKCS8ShroudedKeyBag = class PKCS8ShroudedKeyBag extends asn1_pkcs8_1.EncryptedPrivateKeyInfo {
};
exports.PKCS8ShroudedKeyBag = PKCS8ShroudedKeyBag;
exports.PKCS8ShroudedKeyBag = PKCS8ShroudedKeyBag = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence })
], PKCS8ShroudedKeyBag);
+19
View File
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SecretBag = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
class SecretBag {
constructor(params = {}) {
this.secretTypeId = "";
this.secretValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
exports.SecretBag = SecretBag;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], SecretBag.prototype, "secretTypeId", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, context: 0 })
], SecretBag.prototype, "secretValue", void 0);
+11
View File
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.id_pkcs_9 = exports.id_SafeContents = exports.id_SecretBag = exports.id_CRLBag = exports.id_certBag = exports.id_pkcs8ShroudedKeyBag = exports.id_keyBag = void 0;
const object_identifiers_1 = require("../object_identifiers");
exports.id_keyBag = `${object_identifiers_1.id_bagtypes}.1`;
exports.id_pkcs8ShroudedKeyBag = `${object_identifiers_1.id_bagtypes}.2`;
exports.id_certBag = `${object_identifiers_1.id_bagtypes}.3`;
exports.id_CRLBag = `${object_identifiers_1.id_bagtypes}.4`;
exports.id_SecretBag = `${object_identifiers_1.id_bagtypes}.5`;
exports.id_SafeContents = `${object_identifiers_1.id_bagtypes}.6`;
exports.id_pkcs_9 = "1.2.840.113549.1.9";
+10
View File
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./attribute"), exports);
tslib_1.__exportStar(require("./authenticated_safe"), exports);
tslib_1.__exportStar(require("./bags"), exports);
tslib_1.__exportStar(require("./mac_data"), exports);
tslib_1.__exportStar(require("./object_identifiers"), exports);
tslib_1.__exportStar(require("./pfx"), exports);
tslib_1.__exportStar(require("./safe_bag"), exports);
+24
View File
@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MacData = void 0;
const tslib_1 = require("tslib");
const asn1_rsa_1 = require("@peculiar/asn1-rsa");
const asn1_schema_1 = require("@peculiar/asn1-schema");
class MacData {
constructor(params = {}) {
this.mac = new asn1_rsa_1.DigestInfo();
this.macSalt = new asn1_schema_1.OctetString();
this.iterations = 1;
Object.assign(this, params);
}
}
exports.MacData = MacData;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_rsa_1.DigestInfo })
], MacData.prototype, "mac", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.OctetString })
], MacData.prototype, "macSalt", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer, defaultValue: 1 })
], MacData.prototype, "iterations", void 0);
+14
View File
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.id_bagtypes = exports.id_pbewithSHAAnd40BitRC2_CBC = exports.id_pbeWithSHAAnd128BitRC2_CBC = exports.id_pbeWithSHAAnd2_KeyTripleDES_CBC = exports.id_pbeWithSHAAnd3_KeyTripleDES_CBC = exports.id_pbeWithSHAAnd40BitRC4 = exports.id_pbeWithSHAAnd128BitRC4 = exports.id_pkcs_12PbeIds = exports.id_pkcs_12 = exports.id_pkcs = exports.id_rsadsi = void 0;
exports.id_rsadsi = "1.2.840.113549";
exports.id_pkcs = `${exports.id_rsadsi}.1`;
exports.id_pkcs_12 = `${exports.id_pkcs}.12`;
exports.id_pkcs_12PbeIds = `${exports.id_pkcs_12}.1`;
exports.id_pbeWithSHAAnd128BitRC4 = `${exports.id_pkcs_12PbeIds}.1`;
exports.id_pbeWithSHAAnd40BitRC4 = `${exports.id_pkcs_12PbeIds}.2`;
exports.id_pbeWithSHAAnd3_KeyTripleDES_CBC = `${exports.id_pkcs_12PbeIds}.3`;
exports.id_pbeWithSHAAnd2_KeyTripleDES_CBC = `${exports.id_pkcs_12PbeIds}.4`;
exports.id_pbeWithSHAAnd128BitRC2_CBC = `${exports.id_pkcs_12PbeIds}.5`;
exports.id_pbewithSHAAnd40BitRC2_CBC = `${exports.id_pkcs_12PbeIds}.6`;
exports.id_bagtypes = `${exports.id_pkcs_12}.10.1`;
+25
View File
@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PFX = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_cms_1 = require("@peculiar/asn1-cms");
const mac_data_1 = require("./mac_data");
class PFX {
constructor(params = {}) {
this.version = 3;
this.authSafe = new asn1_cms_1.ContentInfo();
this.macData = new mac_data_1.MacData();
Object.assign(this, params);
}
}
exports.PFX = PFX;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
], PFX.prototype, "version", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_cms_1.ContentInfo })
], PFX.prototype, "authSafe", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: mac_data_1.MacData, optional: true })
], PFX.prototype, "macData", void 0);
+34
View File
@@ -0,0 +1,34 @@
"use strict";
var SafeContents_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SafeContents = exports.SafeBag = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const attribute_1 = require("./attribute");
class SafeBag {
constructor(params = {}) {
this.bagId = "";
this.bagValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
exports.SafeBag = SafeBag;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.ObjectIdentifier })
], SafeBag.prototype, "bagId", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Any, context: 0 })
], SafeBag.prototype, "bagValue", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: attribute_1.PKCS12Attribute, repeated: "set", optional: true })
], SafeBag.prototype, "bagAttributes", void 0);
let SafeContents = SafeContents_1 = class SafeContents extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, SafeContents_1.prototype);
}
};
exports.SafeContents = SafeContents;
exports.SafeContents = SafeContents = SafeContents_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: SafeBag })
], SafeContents);
+26
View File
@@ -0,0 +1,26 @@
var PKCS12AttrSet_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
export class PKCS12Attribute {
constructor(params = {}) {
this.attrId = "";
this.attrValues = [];
Object.assign(params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], PKCS12Attribute.prototype, "attrId", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, repeated: "set" })
], PKCS12Attribute.prototype, "attrValues", void 0);
let PKCS12AttrSet = PKCS12AttrSet_1 = class PKCS12AttrSet extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, PKCS12AttrSet_1.prototype);
}
};
PKCS12AttrSet = PKCS12AttrSet_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: PKCS12Attribute })
], PKCS12AttrSet);
export { PKCS12AttrSet };
+14
View File
@@ -0,0 +1,14 @@
var AuthenticatedSafe_1;
import { __decorate } from "tslib";
import { AsnArray, AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
import { ContentInfo } from "@peculiar/asn1-cms";
let AuthenticatedSafe = AuthenticatedSafe_1 = class AuthenticatedSafe extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, AuthenticatedSafe_1.prototype);
}
};
AuthenticatedSafe = AuthenticatedSafe_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: ContentInfo })
], AuthenticatedSafe);
export { AuthenticatedSafe };
+19
View File
@@ -0,0 +1,19 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { id_pkcs_9 } from "./types";
export class CertBag {
constructor(params = {}) {
this.certId = "";
this.certValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], CertBag.prototype, "certId", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, context: 0 })
], CertBag.prototype, "certValue", void 0);
export const id_certTypes = `${id_pkcs_9}.22`;
export const id_x509Certificate = `${id_certTypes}.1`;
export const id_sdsiCertificate = `${id_certTypes}.2`;
+18
View File
@@ -0,0 +1,18 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { id_pkcs_9 } from "./types";
export class CRLBag {
constructor(params = {}) {
this.crlId = "";
this.crltValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], CRLBag.prototype, "crlId", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, context: 0 })
], CRLBag.prototype, "crltValue", void 0);
export const id_crlTypes = `${id_pkcs_9}.23`;
export const id_x509CRL = `${id_crlTypes}.1`;
+6
View File
@@ -0,0 +1,6 @@
export * from "./cert_bag";
export * from "./crl_bag";
export * from "./key_bag";
export * from "./pkcs8_shrouded_key_bag";
export * from "./secret_bag";
export * from "./types";
+9
View File
@@ -0,0 +1,9 @@
import { __decorate } from "tslib";
import { PrivateKeyInfo } from "@peculiar/asn1-pkcs8";
import { AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
let KeyBag = class KeyBag extends PrivateKeyInfo {
};
KeyBag = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], KeyBag);
export { KeyBag };
@@ -0,0 +1,9 @@
import { __decorate } from "tslib";
import { EncryptedPrivateKeyInfo } from "@peculiar/asn1-pkcs8";
import { AsnType, AsnTypeTypes } from "@peculiar/asn1-schema";
let PKCS8ShroudedKeyBag = class PKCS8ShroudedKeyBag extends EncryptedPrivateKeyInfo {
};
PKCS8ShroudedKeyBag = __decorate([
AsnType({ type: AsnTypeTypes.Sequence })
], PKCS8ShroudedKeyBag);
export { PKCS8ShroudedKeyBag };
+15
View File
@@ -0,0 +1,15 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
export class SecretBag {
constructor(params = {}) {
this.secretTypeId = "";
this.secretValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], SecretBag.prototype, "secretTypeId", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, context: 0 })
], SecretBag.prototype, "secretValue", void 0);
+8
View File
@@ -0,0 +1,8 @@
import { id_bagtypes } from "../object_identifiers";
export const id_keyBag = `${id_bagtypes}.1`;
export const id_pkcs8ShroudedKeyBag = `${id_bagtypes}.2`;
export const id_certBag = `${id_bagtypes}.3`;
export const id_CRLBag = `${id_bagtypes}.4`;
export const id_SecretBag = `${id_bagtypes}.5`;
export const id_SafeContents = `${id_bagtypes}.6`;
export const id_pkcs_9 = "1.2.840.113549.1.9";
+7
View File
@@ -0,0 +1,7 @@
export * from "./attribute";
export * from "./authenticated_safe";
export * from "./bags";
export * from "./mac_data";
export * from "./object_identifiers";
export * from "./pfx";
export * from "./safe_bag";
+20
View File
@@ -0,0 +1,20 @@
import { __decorate } from "tslib";
import { DigestInfo } from "@peculiar/asn1-rsa";
import { AsnProp, AsnPropTypes, OctetString } from "@peculiar/asn1-schema";
export class MacData {
constructor(params = {}) {
this.mac = new DigestInfo();
this.macSalt = new OctetString();
this.iterations = 1;
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: DigestInfo })
], MacData.prototype, "mac", void 0);
__decorate([
AsnProp({ type: OctetString })
], MacData.prototype, "macSalt", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Integer, defaultValue: 1 })
], MacData.prototype, "iterations", void 0);
+11
View File
@@ -0,0 +1,11 @@
export const id_rsadsi = "1.2.840.113549";
export const id_pkcs = `${id_rsadsi}.1`;
export const id_pkcs_12 = `${id_pkcs}.12`;
export const id_pkcs_12PbeIds = `${id_pkcs_12}.1`;
export const id_pbeWithSHAAnd128BitRC4 = `${id_pkcs_12PbeIds}.1`;
export const id_pbeWithSHAAnd40BitRC4 = `${id_pkcs_12PbeIds}.2`;
export const id_pbeWithSHAAnd3_KeyTripleDES_CBC = `${id_pkcs_12PbeIds}.3`;
export const id_pbeWithSHAAnd2_KeyTripleDES_CBC = `${id_pkcs_12PbeIds}.4`;
export const id_pbeWithSHAAnd128BitRC2_CBC = `${id_pkcs_12PbeIds}.5`;
export const id_pbewithSHAAnd40BitRC2_CBC = `${id_pkcs_12PbeIds}.6`;
export const id_bagtypes = `${id_pkcs_12}.10.1`;
+21
View File
@@ -0,0 +1,21 @@
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { ContentInfo } from "@peculiar/asn1-cms";
import { MacData } from "./mac_data";
export class PFX {
constructor(params = {}) {
this.version = 3;
this.authSafe = new ContentInfo();
this.macData = new MacData();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], PFX.prototype, "version", void 0);
__decorate([
AsnProp({ type: ContentInfo })
], PFX.prototype, "authSafe", void 0);
__decorate([
AsnProp({ type: MacData, optional: true })
], PFX.prototype, "macData", void 0);
+30
View File
@@ -0,0 +1,30 @@
var SafeContents_1;
import { __decorate } from "tslib";
import { AsnArray, AsnType, AsnTypeTypes, AsnProp, AsnPropTypes } from "@peculiar/asn1-schema";
import { PKCS12Attribute } from "./attribute";
export class SafeBag {
constructor(params = {}) {
this.bagId = "";
this.bagValue = new ArrayBuffer(0);
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.ObjectIdentifier })
], SafeBag.prototype, "bagId", void 0);
__decorate([
AsnProp({ type: AsnPropTypes.Any, context: 0 })
], SafeBag.prototype, "bagValue", void 0);
__decorate([
AsnProp({ type: PKCS12Attribute, repeated: "set", optional: true })
], SafeBag.prototype, "bagAttributes", void 0);
let SafeContents = SafeContents_1 = class SafeContents extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, SafeContents_1.prototype);
}
};
SafeContents = SafeContents_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: SafeBag })
], SafeContents);
export { SafeContents };
+26
View File
@@ -0,0 +1,26 @@
import { AsnArray } from "@peculiar/asn1-schema";
/**
* ```asn1
* PKCS12Attribute ::= SEQUENCE {
* attrId ATTRIBUTE.&id ({PKCS12AttrSet}),
* attrValues SET OF ATTRIBUTE.&Type ({PKCS12AttrSet}{@attrId})
* } -- This type is compatible with the X.500 type 'Attribute'
* ```
*/
export declare class PKCS12Attribute {
attrId: string;
attrValues: ArrayBuffer[];
constructor(params?: Partial<PKCS12Attribute>);
}
/**
* ```asn1
* PKCS12AttrSet ATTRIBUTE ::= {
* friendlyName |
* localKeyId,
* ... -- Other attributes are allowed
* }
* ```
*/
export declare class PKCS12AttrSet extends AsnArray<PKCS12Attribute> {
constructor(items?: PKCS12Attribute[]);
}
+13
View File
@@ -0,0 +1,13 @@
import { AsnArray } from "@peculiar/asn1-schema";
import { ContentInfo } from "@peculiar/asn1-cms";
/**
* ```asn1
* AuthenticatedSafe ::= SEQUENCE OF ContentInfo
* -- Data if unencrypted
* -- EncryptedData if password-encrypted
* -- EnvelopedData if public key-encrypted
* ```
*/
export declare class AuthenticatedSafe extends AsnArray<ContentInfo> {
constructor(items?: ContentInfo[]);
}
+35
View File
@@ -0,0 +1,35 @@
/**
* ```asn1
* CertBag ::= SEQUENCE {
* certId BAG-TYPE.&id ({CertTypes}),
* certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId})
* }
* ```
*/
export declare class CertBag {
certId: string;
certValue: ArrayBuffer;
constructor(params?: Partial<CertBag>);
}
/**
* ```asn1
* certTypes OBJECT IDENTIFIER ::= {pkcs-9 22}
* ```
*/
export declare const id_certTypes = "1.2.840.113549.1.9.22";
/**
* ```asn1
* x509Certificate BAG-TYPE ::=
* {OCTET STRING IDENTIFIED BY {certTypes 1}}
* -- DER-encoded X.509 certificate stored in OCTET STRING
* ```
*/
export declare const id_x509Certificate = "1.2.840.113549.1.9.22.1";
/**
* ```asn1
* sdsiCertificate BAG-TYPE ::=
* {IA5String IDENTIFIED BY {certTypes 2}}
* -- Base64-encoded SDSI certificate stored in IA5String
* ```
*/
export declare const id_sdsiCertificate = "1.2.840.113549.1.9.22.2";
+27
View File
@@ -0,0 +1,27 @@
/**
* ```asn1
* CRLBag ::= SEQUENCE {
* crlId BAG-TYPE.&id ({CRLTypes}),
* crltValue [0] EXPLICIT BAG-TYPE.&Type ({CRLTypes}{@crlId})
* }
* ```
*/
export declare class CRLBag {
crlId: string;
crltValue: ArrayBuffer;
constructor(params?: Partial<CRLBag>);
}
/**
* ```asn1
* crlTypes OBJECT IDENTIFIER ::= {pkcs-9 23}
* ```
*/
export declare const id_crlTypes = "1.2.840.113549.1.9.23";
/**
* ```asn1
* x509CRL BAG-TYPE ::=
* {OCTET STRING IDENTIFIED BY {crlTypes 1}}
* -- DER-encoded X.509 CRL stored in OCTET STRING
* ```
*/
export declare const id_x509CRL = "1.2.840.113549.1.9.23.1";
+6
View File
@@ -0,0 +1,6 @@
export * from "./cert_bag";
export * from "./crl_bag";
export * from "./key_bag";
export * from "./pkcs8_shrouded_key_bag";
export * from "./secret_bag";
export * from "./types";
+8
View File
@@ -0,0 +1,8 @@
import { PrivateKeyInfo } from "@peculiar/asn1-pkcs8";
/**
* ```asn1
* KeyBag ::= PrivateKeyInfo
* ```
*/
export declare class KeyBag extends PrivateKeyInfo {
}
@@ -0,0 +1,8 @@
import { EncryptedPrivateKeyInfo } from "@peculiar/asn1-pkcs8";
/**
* ```asn1
* PKCS8ShroudedKeyBag ::= EncryptedPrivateKeyInfo
* ```
*/
export declare class PKCS8ShroudedKeyBag extends EncryptedPrivateKeyInfo {
}
+14
View File
@@ -0,0 +1,14 @@
/**
* ```asn1
* SecretBag ::= SEQUENCE {
* secretTypeId BAG-TYPE.&id ({SecretTypes}),
* secretValue [0] EXPLICIT BAG-TYPE.&Type ({SecretTypes}
* {@secretTypeId})
* }
* ```
*/
export declare class SecretBag {
secretTypeId: string;
secretValue: ArrayBuffer;
constructor(params?: Partial<SecretBag>);
}
+49
View File
@@ -0,0 +1,49 @@
/**
* ```asn1
* keyBag BAG-TYPE ::=
* {KeyBag IDENTIFIED BY {bagtypes 1}}
* ```
*/
export declare const id_keyBag = "1.2.840.113549.1.12.10.1.1";
/**
* ```asn1
* pkcs8ShroudedKeyBag BAG-TYPE ::=
* {PKCS8ShroudedKeyBag IDENTIFIED BY {bagtypes 2}}
* ```
*/
export declare const id_pkcs8ShroudedKeyBag = "1.2.840.113549.1.12.10.1.2";
/**
* ```asn1
* certBag BAG-TYPE ::=
* {CertBag IDENTIFIED BY {bagtypes 3}}
* ```
*/
export declare const id_certBag = "1.2.840.113549.1.12.10.1.3";
/**
* ```asn1
* crlBag BAG-TYPE ::=
* {CRLBag IDENTIFIED BY {bagtypes 4}}
* ```
*/
export declare const id_CRLBag = "1.2.840.113549.1.12.10.1.4";
/**
* ```asn1
* secretBag BAG-TYPE ::=
* {SecretBag IDENTIFIED BY {bagtypes 5}}
* ```
*/
export declare const id_SecretBag = "1.2.840.113549.1.12.10.1.5";
/**
* ```asn1
* safeContentsBag BAG-TYPE ::=
* {SafeContents IDENTIFIED BY {bagtypes 6}}
* ```
*/
export declare const id_SafeContents = "1.2.840.113549.1.12.10.1.6";
/**
* ```asn1
* pkcs-9 OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840)
* rsadsi(113549) pkcs(1) 9}
* ```
*/
export declare const id_pkcs_9 = "1.2.840.113549.1.9";
+7
View File
@@ -0,0 +1,7 @@
export * from "./attribute";
export * from "./authenticated_safe";
export * from "./bags";
export * from "./mac_data";
export * from "./object_identifiers";
export * from "./pfx";
export * from "./safe_bag";
+19
View File
@@ -0,0 +1,19 @@
import { DigestInfo } from "@peculiar/asn1-rsa";
import { OctetString } from "@peculiar/asn1-schema";
/**
* ```asn1
* MacData ::= SEQUENCE {
* mac DigestInfo,
* macSalt OCTET STRING,
* iterations INTEGER DEFAULT 1
* -- Note: The default is for historical reasons and its use is
* -- deprecated.
* }
* ```
*/
export declare class MacData {
mac: DigestInfo;
macSalt: OctetString;
iterations: number;
constructor(params?: Partial<MacData>);
}
+67
View File
@@ -0,0 +1,67 @@
/**
* ```asn1
* rsadsi OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840)
* rsadsi(113549)}
* ```
*/
export declare const id_rsadsi = "1.2.840.113549";
/**
* ```asn1
* pkcs OBJECT IDENTIFIER ::= {rsadsi pkcs(1)}
* ```
*/
export declare const id_pkcs = "1.2.840.113549.1";
/**
* ```asn1
* pkcs-12 OBJECT IDENTIFIER ::= {pkcs 12}
* ```
*/
export declare const id_pkcs_12 = "1.2.840.113549.1.12";
/**
* ```asn1
* pkcs-12PbeIds OBJECT IDENTIFIER ::= {pkcs-12 1}
* ```
*/
export declare const id_pkcs_12PbeIds = "1.2.840.113549.1.12.1";
/**
* ```asn1
* pbeWithSHAAnd128BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 1}
* ```
*/
export declare const id_pbeWithSHAAnd128BitRC4 = "1.2.840.113549.1.12.1.1";
/**
* ```asn1
* pbeWithSHAAnd40BitRC4 OBJECT IDENTIFIER ::= {pkcs-12PbeIds 2}
* ```
*/
export declare const id_pbeWithSHAAnd40BitRC4 = "1.2.840.113549.1.12.1.2";
/**
* ```asn1
* pbeWithSHAAnd3-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 3}
* ```
*/
export declare const id_pbeWithSHAAnd3_KeyTripleDES_CBC = "1.2.840.113549.1.12.1.3";
/**
* ```asn1
* pbeWithSHAAnd2-KeyTripleDES-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 4}
* ```
*/
export declare const id_pbeWithSHAAnd2_KeyTripleDES_CBC = "1.2.840.113549.1.12.1.4";
/**
* ```asn1
* pbeWithSHAAnd128BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 5}
* ```
*/
export declare const id_pbeWithSHAAnd128BitRC2_CBC = "1.2.840.113549.1.12.1.5";
/**
* ```asn1
* pbewithSHAAnd40BitRC2-CBC OBJECT IDENTIFIER ::= {pkcs-12PbeIds 6}
* ```
*/
export declare const id_pbewithSHAAnd40BitRC2_CBC = "1.2.840.113549.1.12.1.6";
/**
* ```asn1
* bagtypes OBJECT IDENTIFIER ::= {pkcs-12 10 1}
* ```
*/
export declare const id_bagtypes = "1.2.840.113549.1.12.10.1";
+17
View File
@@ -0,0 +1,17 @@
import { ContentInfo } from "@peculiar/asn1-cms";
import { MacData } from "./mac_data";
/**
* ```asn1
* PFX ::= SEQUENCE {
* version INTEGER {v3(3)}(v3,...),
* authSafe ContentInfo,
* macData MacData OPTIONAL
* }
* ```
*/
export declare class PFX {
version: number;
authSafe: ContentInfo;
macData: MacData;
constructor(params?: Partial<PFX>);
}
+25
View File
@@ -0,0 +1,25 @@
import { AsnArray } from "@peculiar/asn1-schema";
import { PKCS12Attribute } from "./attribute";
/**
* ```asn1
* SafeBag ::= SEQUENCE {
* bagId BAG-TYPE.&id ({PKCS12BagSet}),
* bagValue [0] EXPLICIT BAG-TYPE.&Type({PKCS12BagSet}{@bagId}),
* bagAttributes SET OF PKCS12Attribute OPTIONAL
* }
* ```
*/
export declare class SafeBag {
bagId: string;
bagValue: ArrayBuffer;
bagAttributes?: PKCS12Attribute[];
constructor(params?: Partial<SafeBag>);
}
/**
* ```asn1
* SafeContents ::= SEQUENCE OF SafeBag
* ```
*/
export declare class SafeContents extends AsnArray<SafeBag> {
constructor(items?: SafeBag[]);
}
+45
View File
@@ -0,0 +1,45 @@
{
"name": "@peculiar/asn1-pfx",
"version": "2.6.1",
"description": "ASN.1 schema of `PKCS #12: Personal Information Exchange Syntax v1.1` (RFC7292)",
"files": [
"build/**/*.{js,d.ts}",
"LICENSE",
"README.md"
],
"bugs": {
"url": "https://github.com/PeculiarVentures/asn1-schema/issues"
},
"homepage": "https://github.com/PeculiarVentures/asn1-schema/tree/master/packages/pfx#readme",
"keywords": [
"asn"
],
"author": "PeculiarVentures, LLC",
"license": "MIT",
"main": "build/cjs/index.js",
"module": "build/es2015/index.js",
"types": "build/types/index.d.ts",
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "mocha",
"clear": "rimraf build",
"build": "npm run build:module && npm run build:types",
"build:module": "npm run build:cjs && npm run build:es2015",
"build:cjs": "tsc -p tsconfig.compile.json --removeComments --module commonjs --outDir build/cjs",
"build:es2015": "tsc -p tsconfig.compile.json --removeComments --module ES2015 --outDir build/es2015",
"prebuild:types": "rimraf build/types",
"build:types": "tsc -p tsconfig.compile.json --outDir build/types --declaration --emitDeclarationOnly",
"rebuild": "npm run clear && npm run build"
},
"dependencies": {
"@peculiar/asn1-cms": "^2.6.1",
"@peculiar/asn1-pkcs8": "^2.6.1",
"@peculiar/asn1-rsa": "^2.6.1",
"@peculiar/asn1-schema": "^2.6.0",
"asn1js": "^3.0.6",
"tslib": "^2.8.1"
},
"gitHead": "e533eba96fe14ca21b9a1b3f47cb58aaaa78c0ad"
}