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-pkcs8`
[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/PeculiarVentures/asn1-schema/master/packages/pkcs8/LICENSE.md)
[![npm version](https://badge.fury.io/js/%40peculiar%2Fasn1-pkcs8.svg)](https://badge.fury.io/js/%40peculiar%2Fasn1-pkcs8)
[![NPM](https://nodei.co/npm/@peculiar/asn1-pkcs8.png)](https://nodei.co/npm/@peculiar/asn1-pkcs8/)
[RFC 5208](https://tools.ietf.org/html/rfc5208) Public-Key Cryptography Standards (PKCS) #8: Private-Key Information Syntax Specification Version 1.2
@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EncryptedPrivateKeyInfo = exports.EncryptedData = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_x509_1 = require("@peculiar/asn1-x509");
class EncryptedData extends asn1_schema_1.OctetString {
}
exports.EncryptedData = EncryptedData;
class EncryptedPrivateKeyInfo {
constructor(params = {}) {
this.encryptionAlgorithm = new asn1_x509_1.AlgorithmIdentifier();
this.encryptedData = new EncryptedData();
Object.assign(this, params);
}
}
exports.EncryptedPrivateKeyInfo = EncryptedPrivateKeyInfo;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })
], EncryptedPrivateKeyInfo.prototype, "encryptionAlgorithm", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: EncryptedData })
], EncryptedPrivateKeyInfo.prototype, "encryptedData", void 0);
+5
View File
@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./encrypted_private_key_info"), exports);
tslib_1.__exportStar(require("./private_key_info"), exports);
+45
View File
@@ -0,0 +1,45 @@
"use strict";
var Attributes_1;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrivateKeyInfo = exports.Attributes = exports.PrivateKey = exports.Version = void 0;
const tslib_1 = require("tslib");
const asn1_schema_1 = require("@peculiar/asn1-schema");
const asn1_x509_1 = require("@peculiar/asn1-x509");
var Version;
(function (Version) {
Version[Version["v1"] = 0] = "v1";
})(Version || (exports.Version = Version = {}));
class PrivateKey extends asn1_schema_1.OctetString {
}
exports.PrivateKey = PrivateKey;
let Attributes = Attributes_1 = class Attributes extends asn1_schema_1.AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, Attributes_1.prototype);
}
};
exports.Attributes = Attributes;
exports.Attributes = Attributes = Attributes_1 = tslib_1.__decorate([
(0, asn1_schema_1.AsnType)({ type: asn1_schema_1.AsnTypeTypes.Sequence, itemType: asn1_x509_1.Attribute })
], Attributes);
class PrivateKeyInfo {
constructor(params = {}) {
this.version = Version.v1;
this.privateKeyAlgorithm = new asn1_x509_1.AlgorithmIdentifier();
this.privateKey = new PrivateKey();
Object.assign(this, params);
}
}
exports.PrivateKeyInfo = PrivateKeyInfo;
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_schema_1.AsnPropTypes.Integer })
], PrivateKeyInfo.prototype, "version", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: asn1_x509_1.AlgorithmIdentifier })
], PrivateKeyInfo.prototype, "privateKeyAlgorithm", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: PrivateKey })
], PrivateKeyInfo.prototype, "privateKey", void 0);
tslib_1.__decorate([
(0, asn1_schema_1.AsnProp)({ type: Attributes, implicit: true, context: 0, optional: true })
], PrivateKeyInfo.prototype, "attributes", void 0);
@@ -0,0 +1,18 @@
import { __decorate } from "tslib";
import { AsnProp, OctetString } from "@peculiar/asn1-schema";
import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
export class EncryptedData extends OctetString {
}
export class EncryptedPrivateKeyInfo {
constructor(params = {}) {
this.encryptionAlgorithm = new AlgorithmIdentifier();
this.encryptedData = new EncryptedData();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AlgorithmIdentifier })
], EncryptedPrivateKeyInfo.prototype, "encryptionAlgorithm", void 0);
__decorate([
AsnProp({ type: EncryptedData })
], EncryptedPrivateKeyInfo.prototype, "encryptedData", void 0);
+2
View File
@@ -0,0 +1,2 @@
export * from "./encrypted_private_key_info";
export * from "./private_key_info";
+40
View File
@@ -0,0 +1,40 @@
var Attributes_1;
import { __decorate } from "tslib";
import { AsnProp, AsnPropTypes, AsnArray, AsnType, AsnTypeTypes, OctetString, } from "@peculiar/asn1-schema";
import { AlgorithmIdentifier, Attribute } from "@peculiar/asn1-x509";
export var Version;
(function (Version) {
Version[Version["v1"] = 0] = "v1";
})(Version || (Version = {}));
export class PrivateKey extends OctetString {
}
let Attributes = Attributes_1 = class Attributes extends AsnArray {
constructor(items) {
super(items);
Object.setPrototypeOf(this, Attributes_1.prototype);
}
};
Attributes = Attributes_1 = __decorate([
AsnType({ type: AsnTypeTypes.Sequence, itemType: Attribute })
], Attributes);
export { Attributes };
export class PrivateKeyInfo {
constructor(params = {}) {
this.version = Version.v1;
this.privateKeyAlgorithm = new AlgorithmIdentifier();
this.privateKey = new PrivateKey();
Object.assign(this, params);
}
}
__decorate([
AsnProp({ type: AsnPropTypes.Integer })
], PrivateKeyInfo.prototype, "version", void 0);
__decorate([
AsnProp({ type: AlgorithmIdentifier })
], PrivateKeyInfo.prototype, "privateKeyAlgorithm", void 0);
__decorate([
AsnProp({ type: PrivateKey })
], PrivateKeyInfo.prototype, "privateKey", void 0);
__decorate([
AsnProp({ type: Attributes, implicit: true, context: 0, optional: true })
], PrivateKeyInfo.prototype, "attributes", void 0);
@@ -0,0 +1,22 @@
import { OctetString } from "@peculiar/asn1-schema";
import { AlgorithmIdentifier } from "@peculiar/asn1-x509";
/**
* ```asn1
* EncryptedData ::= OCTET STRING
* ```
*/
export declare class EncryptedData extends OctetString {
}
/**
* ```asn1
* EncryptedPrivateKeyInfo ::= SEQUENCE {
* encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
* encryptedData EncryptedData
* }
* ```
*/
export declare class EncryptedPrivateKeyInfo {
encryptionAlgorithm: AlgorithmIdentifier;
encryptedData: EncryptedData;
constructor(params?: Partial<EncryptedPrivateKeyInfo>);
}
+2
View File
@@ -0,0 +1,2 @@
export * from "./encrypted_private_key_info";
export * from "./private_key_info";
+41
View File
@@ -0,0 +1,41 @@
import { AsnArray, OctetString } from "@peculiar/asn1-schema";
import { AlgorithmIdentifier, Attribute } from "@peculiar/asn1-x509";
/**
* ```asn1
* Version ::= INTEGER {v1(0)} (v1,...)
* ```
*/
export declare enum Version {
v1 = 0
}
/**
* ```asn1
* PrivateKey ::= OCTET STRING
* ```
*/
export declare class PrivateKey extends OctetString {
}
/**
* ```asn1
* Attributes ::= SET OF Attribute
* ```
*/
export declare class Attributes extends AsnArray<Attribute> {
constructor(items?: Attribute[]);
}
/**
* ```asn1
* PrivateKeyInfo ::= SEQUENCE {
* version Version,
* privateKeyAlgorithm AlgorithmIdentifier {{PrivateKeyAlgorithms}},
* privateKey PrivateKey,
* attributes [0] Attributes OPTIONAL }
* ```
*/
export declare class PrivateKeyInfo {
version: Version;
privateKeyAlgorithm: AlgorithmIdentifier;
privateKey: PrivateKey;
attributes?: Attributes;
constructor(params?: Partial<PrivateKeyInfo>);
}
+42
View File
@@ -0,0 +1,42 @@
{
"name": "@peculiar/asn1-pkcs8",
"version": "2.6.1",
"description": "ASN.1 schema of `Public-Key Cryptography Standards (PKCS) #8: Private-Key Information Syntax Specification Version 1.2` (RFC5208)",
"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/pkcs8#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": {
"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-schema": "^2.6.0",
"@peculiar/asn1-x509": "^2.6.1",
"asn1js": "^3.0.6",
"tslib": "^2.8.1"
},
"gitHead": "e533eba96fe14ca21b9a1b3f47cb58aaaa78c0ad"
}