express server läuft jetzt mit https
This commit is contained in:
Lukas Nowy
2018-12-16 19:08:08 +01:00
parent 5589b0df3f
commit fd947bd852
475 changed files with 91128 additions and 0 deletions

63
express-server/node_modules/pkijs/.gitattributes generated vendored Normal file
View File

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

1
express-server/node_modules/pkijs/.npmignore generated vendored Normal file
View File

@ -0,0 +1 @@
/examples

30
express-server/node_modules/pkijs/LICENSE generated vendored Normal file
View File

@ -0,0 +1,30 @@
Copyright (c) 2014, GMO GlobalSign
Copyright (c) 2015, Peculiar Ventures
All rights reserved.
Author 2014-2015, Yury Strozhevsky
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

287
express-server/node_modules/pkijs/README.md generated vendored Normal file
View File

@ -0,0 +1,287 @@
# PKIjs
[![license](https://img.shields.io/badge/license-BSD-green.svg?style=flat)](https://raw.githubusercontent.com/GlobalSign/PKI.js/master/LICENSE)
Public Key Infrastructure (PKI) is the basis of how identity and key management is performed on the web today. PKIjs is a pure JavaScript library implementing the formats that are used in PKI applications. It is built on WebCrypto ([Web Cryptography API](http://www.w3.org/TR/WebCryptoAPI/)) and aspires to make it possible to build native web applications that utilize X.509 and the related formats on the web without plug-ins.
## Introduction
[PKIjs][] is a library made in order to help people deal with (sometimes) complicated world of PKI-related data. For the moment it is quite easy to create a simple signature but hard to create PKCS#7 encoded signature. Easy to read a X.509 certificate but hard to parse values within it. [PKIjs][] library will help all web applications (and chrome plug-ins) acomplish these and many other things. [PKIjs][] was designed in such a way to make it easy to extended by users through a use of layered internal structures. There are [**many examples**](https://github.com/GlobalSign/PKI.js/tree/master/examples) of using [PKIjs][] and the number of examples will grow.
## Numbers behind the library
* More than 25 000 lines of code and comments ([PKIjs][] library + [ASN1js][] library).
* More than 50 specialized pre-defined ASN.1 schemas.
* More than 50 specialized "helpers" working with almost all internal data (for example "GeneralName" type, all X.509 certificate extensions types, "revoked certificates" type, etc.).
* Everything that you need to work with all five major parts of PKI: X.509, PKCS#10, CMS, OCSP, Time-stamping.
## Features of the library
* First and **ONLY** (April 2015) open-source JS library with full support for all "Suite B" algorithms in CMS messages;
* First library with support for CMS Enveloped data (encrypt/decrypt) in pure JavaScript + Web Cryptography API;
* Fully object-oriented library. Inhiritence is using everywhere inside the lib;
* Working with HTML5 data objects (ArrayBuffer, Uint8Array, Promises, Web Cryptography API, etc.);
* Has a complete set of helpers for working with types like:
* GeneralName;
* RelativeDistinguishedName;
* Time;
* AlgorithmIdentifier;
* All types of ASN.1 strings, including "international" like UniversalString, UTF8String and BMPString (with help from [ASN1js][]);
* All extension types of X.509 certificates (BasicConstraints, CertificatePolicies, AuthorityKeyIdentifier etc.);
* All "support types" for OCSP requests and responces;
* All "support types" for Time-Stamping Protocol (TSP) requests and responces;
* **Has own certification chain verification engine, built in pure JavaScript, with help from Promises and Web Cryptography API latest standard implementation;**
* Working with **all** Web Cryptography API signature algorithms:
* RSASSA-PKCS1-v1_5;
* RSA-PSS;
* ECDSA;
* Working with **all** "Suite B" (and more) encryption algorithms and schemas:
* RSASSA-OAEP + AES-KW + AES-CBC/GCM;
* ECDH + KDF on SHA-1/256/384/512 + AES-KW + AES-CBC/GCM;
* Pre-defined "key encryption key" + AES-KW + AES-CBC/GCM;
* Password-based encryption for CMS with PBKDF2 on HMAC on SHA-1/256/384/512 + AES-KW + AES-CBC/GCM;
* Working with all major PKI-related types ("minor" types are not mentioned here but there are huge number of such "minor types"):
* X.509 certificates:
* Parsing internal values;
* Getting/setting any internal values;
* Creatiion of a new X.509 certificate "from scratch";
* **Internal certificate chain validation engine**;
* X.509 "certificate revocation lists" (CRLs):
* Parsing internal values;
* Getting/setting any internal values;
* Creation of a new CRL "from scratch";
* Validation of CRL signature;
* Search inside CRL for specific revoked certificate.
* PKCS#10 certificate request:
* Parsing internal values;
* Getting/setting any internal values;
* Creation of a new PKCS#10 certificate request "from scratch";
* Validation of PKCS#10 signature;
* OCSP request:
* Parsing internal values;
* Getting/setting any internal values;
* Creation of a new OCSP request "from scratch".
* OCSP response:
* Parsing internal values;
* Getting/setting any internal values;
* Creation of a new OCSP response "from scratch";
* Validation of OCSP response signature.
* Time-stamping request:
* Parsing internal values;
* Getting/setting any internal values;
* Creation of a new Time-stamping request "from scratch";
* Validation of Time-stamping request signature;
* Time-stamping response:
* Parsing internal values;
* Getting/setting any internal values;
* Creation of a new Time-stamping response "from scratch";
* Validation of Time-stamping response signature
* CMS Signed Data:
* Parsing internal values;
* Getting/setting any internal values;
* Creation of a new CMS Signed Data "from scratch";
* Validation of CMS Signed Data signature;
* CMS Enveloped Data:
* Parsing internal values;
* Getting/setting any internal values;
* Creation (encryption) with full support for "Suite B" algorithms and more;
* Decryption with full support for "Suite B" algorithms and more;
* CMS Encrypted Data:
* Parsing internal values;
* Getting/setting any internal values;
* Creation (encryption) with password;
* Decryption with password;
* PKCS#12:
* Parsing internal values;
* Making any kind of internal values (SafeContexts/SafeBags) with any kind of parameters;
## Examples
```javascript
// #region Parsing raw data as a X.509 certificate object
var asn1 = org.pkijs.fromBER(buffer);
var cert_simpl = new org.pkijs.simpl.CERT({ schema: asn1.result });
// #endregion
```
```javascript
// #region Creation of a new X.509 certificate
cert_simpl.serialNumber = new org.pkijs.asn1.INTEGER({ value: 1 });
cert_simpl.issuer.types_and_values.push(new org.pkijs.simpl.ATTR_TYPE_AND_VALUE({
type: "2.5.4.6", // Country name
value: new org.pkijs.asn1.PRINTABLESTRING({ value: "RU" })
}));
cert_simpl.issuer.types_and_values.push(new org.pkijs.simpl.ATTR_TYPE_AND_VALUE({
type: "2.5.4.3", // Common name
value: new org.pkijs.asn1.PRINTABLESTRING({ value: "Test" })
}));
cert_simpl.subject.types_and_values.push(new org.pkijs.simpl.ATTR_TYPE_AND_VALUE({
type: "2.5.4.6", // Country name
value: new org.pkijs.asn1.PRINTABLESTRING({ value: "RU" })
}));
cert_simpl.subject.types_and_values.push(new org.pkijs.simpl.ATTR_TYPE_AND_VALUE({
type: "2.5.4.3", // Common name
value: new org.pkijs.asn1.PRINTABLESTRING({ value: "Test" })
}));
cert_simpl.notBefore.value = new Date(2013, 01, 01);
cert_simpl.notAfter.value = new Date(2016, 01, 01);
cert_simpl.extensions = new Array(); // Extensions are not a part of certificate by default, it's an optional array
// #region "BasicConstraints" extension
var basic_constr = new org.pkijs.simpl.x509.BasicConstraints({
cA: true,
pathLenConstraint: 3
});
cert_simpl.extensions.push(new org.pkijs.simpl.EXTENSION({
extnID: "2.5.29.19",
critical: false,
extnValue: basic_constr.toSchema().toBER(false),
parsedValue: basic_constr // Parsed value for well-known extensions
}));
// #endregion
// #region "KeyUsage" extension
var bit_array = new ArrayBuffer(1);
var bit_view = new Uint8Array(bit_array);
bit_view[0] = bit_view[0] | 0x02; // Key usage "cRLSign" flag
bit_view[0] = bit_view[0] | 0x04; // Key usage "keyCertSign" flag
var key_usage = new org.pkijs.asn1.BITSTRING({ value_hex: bit_array });
cert_simpl.extensions.push(new org.pkijs.simpl.EXTENSION({
extnID: "2.5.29.15",
critical: false,
extnValue: key_usage.toBER(false),
parsedValue: key_usage // Parsed value for well-known extensions
}));
// #endregion
// #endregion
```
```javascript
// #region Creation of a new CMS Signed Data
cms_signed_simpl = new org.pkijs.simpl.CMS_SIGNED_DATA({
encapContentInfo: new org.pkijs.simpl.cms.EncapsulatedContentInfo({
eContentType: "1.2.840.113549.1.7.1", // "data" content type
eContent: new org.pkijs.asn1.OCTETSTRING({ value_hex: buffer })
}),
signerInfos: [
new org.pkijs.simpl.CMS_SIGNER_INFO({
sid: new org.pkijs.simpl.cms.IssuerAndSerialNumber({
issuer: cert_simpl.issuer,
serialNumber: cert_simpl.serialNumber
})
})
],
certificates: [cert_simpl]
});
return cms_signed_simpl.sign(privateKey, 0, hashAlgorithm);
// #endregion
```
More examples could be found in [**"examples" folder**](https://github.com/GlobalSign/PKI.js/tree/master/examples). Live example can be found at [pkijs.org](https://pkijs.org).
## Limitations
* Does not work with Internet Explorer's implementation of Web Cryptography API it is based on a old draft and also does not support all needed capabilities.
* Does not work with PolyCrypt it is based on a old version of Web Cryptography API and is buggy.
* You can use [PKIjs][] in almost all browsers. Please check [this page](http://caniuse.com/#feat=cryptography) for information about Web Cryptography API browser support.
## Suitability
At this time this library should be considered suitable for research and experimentation, futher code and security review is needed before utilization in a production application.
## Bug Reporting
Please report bugs either as pull requests or as issues in the issue tracker. PKIjs has a full disclosure vulnerability policy. Please do NOT attempt to report any security vulnerability in this code privately to anybody.
## Related source code
* [ASN1js project](https://github.com/GlobalSign/ASN1.js) - in fact [PKIjs][] will not work without [ASN1js][], it's neccessary part of the [PKIjs][] project;
* [C++ ASN1:2008 BER coder/decoder](https://github.com/YuryStrozhevsky/C-plus-plus-ASN.1-2008-coder-decoder) - the "father" of [ASN1js][] project;
* [Freely available ASN.1:2008 test suite](https://github.com/YuryStrozhevsky/ASN1-2008-free-test-suite) - the suite which can help you to validate (and better understand) any ASN.1 coder/decoder;
## How to use PKIjs with Node.js
**!!! WARNING !!!**
**Currently there is no "polyfill" of Web Cryptography API in Node.js. Thus you will not be able to use signature / verification features of PKIjs in Node.js programs.**
In order to use PKIjs you will also need [ASN1js][] plus [node.extend](https://www.npmjs.com/package/node.extend) package.
```javascript
var merge = require("node.extend");
var common = require("asn1js/org/pkijs/common");
var _asn1js = require("asn1js");
var _pkijs = require("pkijs");
var _x509schema = require("pkijs/org/pkijs/x509_schema");
// #region Merging function/object declarations for ASN1js and PKIjs
var asn1js = merge(true, _asn1js, common);
var x509schema = merge(true, _x509schema, asn1js);
var pkijs_1 = merge(true, _pkijs, asn1js);
var pkijs = merge(true, pkijs_1, x509schema);
// #endregion
```
After that you will ba able to use ASN1js and PKIjs via common way:
```javascript
// #region Decode and parse X.509 cert
var asn1 = pkijs.org.pkijs.fromBER(certBuffer);
var cert;
try
{
cert = new pkijs.org.pkijs.simpl.CERT({ schema: asn1.result });
}
catch(ex)
{
return;
}
// #endregion
```
## License
Copyright (c) 2014, [GMO GlobalSign](http://www.globalsign.com/)
Copyright (c) 2015, [Peculiar Ventures](http://peculiarventures.com/)
All rights reserved.
Author 2014-2015, [Yury Strozhevsky](http://www.strozhevsky.com/).
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.
[ASN.1]: http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One
[ASN1js]: http://asn1js.org/
[PKIjs]: http://pkijs.org/
[BER]: http://en.wikipedia.org/wiki/X.690#BER_encoding
[DER]: http://en.wikipedia.org/wiki/X.690#DER_encoding
[freely available ASN.1:2008 test suite]: http://www.strozhevsky.com/free_docs/free_asn1_testsuite_descr.pdf

1259
express-server/node_modules/pkijs/org/pkijs/cms_schema.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

6933
express-server/node_modules/pkijs/org/pkijs/cms_simpl.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

1559
express-server/node_modules/pkijs/org/pkijs/common.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,833 @@
/*
* Copyright (c) 2014, GMO GlobalSign
* Copyright (c) 2015, Peculiar Ventures
* All rights reserved.
*
* Author 2014-2015, Yury Strozhevsky <www.strozhevsky.com>.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
*/
(
function(in_window)
{
//**************************************************************************************
// #region Declaration of global variables
//**************************************************************************************
// #region "org" namespace
if(typeof in_window.org === "undefined")
in_window.org = {};
else
{
if(typeof in_window.org !== "object")
throw new Error("Name org already exists and it's not an object");
}
// #endregion
// #region "org.pkijs" namespace
if(typeof in_window.org.pkijs === "undefined")
in_window.org.pkijs = {};
else
{
if(typeof in_window.org.pkijs !== "object")
throw new Error("Name org.pkijs already exists and it's not an object" + " but " + (typeof in_window.org.pkijs));
}
// #endregion
// #region "org.pkijs.schema" namespace
if(typeof in_window.org.pkijs.schema === "undefined")
in_window.org.pkijs.schema = {};
else
{
if(typeof in_window.org.pkijs.schema !== "object")
throw new Error("Name org.pkijs.schema already exists and it's not an object" + " but " + (typeof in_window.org.pkijs.schema));
}
// #endregion
// #region "org.pkijs.schema.ocsp" namespace
if(typeof in_window.org.pkijs.schema.ocsp === "undefined")
in_window.org.pkijs.schema.ocsp = {};
else
{
if(typeof in_window.org.pkijs.schema.ocsp !== "object")
throw new Error("Name org.pkijs.schema.ocsp already exists and it's not an object" + " but " + (typeof in_window.org.pkijs.schema.ocsp));
}
// #endregion
// #region "org.pkijs.schema.tsp" namespace
if(typeof in_window.org.pkijs.schema.tsp === "undefined")
in_window.org.pkijs.schema.tsp = {};
else
{
if(typeof in_window.org.pkijs.schema.tsp !== "object")
throw new Error("Name org.pkijs.schema.tsp already exists and it's not an object" + " but " + (typeof in_window.org.pkijs.schema.tsp));
}
// #endregion
// #region "local" namespace
var local = {};
// #endregion
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for OCSP request (RFC6960)
//**************************************************************************************
in_window.org.pkijs.schema.ocsp.CertID =
function()
{
//CertID ::= SEQUENCE {
// hashAlgorithm AlgorithmIdentifier,
// issuerNameHash OCTET STRING, -- Hash of issuer's DN
// issuerKeyHash OCTET STRING, -- Hash of issuer's public key
// serialNumber CertificateSerialNumber }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
in_window.org.pkijs.schema.ALGORITHM_IDENTIFIER(names.hashAlgorithm_object || {
names: {
block_name: (names.hashAlgorithm || "")
}
}),
new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.issuerNameHash || "") }),
new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.issuerKeyHash || "") }),
new in_window.org.pkijs.asn1.INTEGER({ name: (names.serialNumber || "") })
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.ocsp.Request =
function()
{
//Request ::= SEQUENCE {
// reqCert CertID,
// singleRequestExtensions [0] EXPLICIT Extensions OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
in_window.org.pkijs.schema.ocsp.CertID(names.reqCert || {}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [in_window.org.pkijs.schema.EXTENSIONS(names.extensions || {
names: {
block_name: (names.singleRequestExtensions || "")
}
})]
})
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.ocsp.TBSRequest =
function()
{
//TBSRequest ::= SEQUENCE {
// version [0] EXPLICIT Version DEFAULT v1,
// requestorName [1] EXPLICIT GeneralName OPTIONAL,
// requestList SEQUENCE OF Request,
// requestExtensions [2] EXPLICIT Extensions OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || "TBSRequest"),
value: [
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [new in_window.org.pkijs.asn1.INTEGER({ name: (names.TBSRequest_version || "TBSRequest.version") })]
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 1 // [1]
},
value: [in_window.org.pkijs.schema.GENERAL_NAME(names.requestorName || {
names: {
block_name: "TBSRequest.requestorName"
}
})]
}),
new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.requestList || "TBSRequest.requestList"),
value: [
new in_window.org.pkijs.asn1.REPEATED({
name: (names.requests || "TBSRequest.requests"),
value: in_window.org.pkijs.schema.ocsp.Request(names.requestNames || {})
})
]
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 2 // [2]
},
value: [in_window.org.pkijs.schema.EXTENSIONS(names.extensions || {
names: {
block_name: (names.requestExtensions || "TBSRequest.requestExtensions")
}
})]
})
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.ocsp.Signature =
function()
{
//Signature ::= SEQUENCE {
// signatureAlgorithm AlgorithmIdentifier,
// signature BIT STRING,
// certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
in_window.org.pkijs.schema.ALGORITHM_IDENTIFIER(names.signatureAlgorithm || {}),
new in_window.org.pkijs.asn1.BITSTRING({ name: (names.signature || "") }),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [
new in_window.org.pkijs.asn1.SEQUENCE({
value: [new in_window.org.pkijs.asn1.REPEATED({
name: (names.certs || ""),
value: in_window.org.pkijs.schema.CERT(names.certs || {})
})]
})
]
})
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.OCSP_REQUEST =
function()
{
//OCSPRequest ::= SEQUENCE {
// tbsRequest TBSRequest,
// optionalSignature [0] EXPLICIT Signature OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: names.block_name || "OCSPRequest",
value: [
in_window.org.pkijs.schema.ocsp.TBSRequest(names.tbsRequest || {
names: {
block_name: "tbsRequest"
}
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [
in_window.org.pkijs.schema.ocsp.Signature(names.optionalSignature || {
names: {
block_name: "optionalSignature"
}
})
]
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "ResponderID" type
//**************************************************************************************
in_window.org.pkijs.schema.ocsp.ResponderID =
function()
{
// KeyHash ::= OCTET STRING
//
// ResponderID ::= CHOICE {
// byName [1] Name,
// byKey [2] KeyHash }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.CHOICE({
value: [
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
name: (names.block_name || ""),
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 1 // [1]
},
value: [in_window.org.pkijs.schema.RDN(names.byName || {
names: {
block_name: ""
}
})]
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
name: (names.block_name || ""),
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 2 // [2]
},
value: [new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.byKey || "") })]
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for OCSP response (RFC6960)
//**************************************************************************************
in_window.org.pkijs.schema.ocsp.ResponseBytes =
function()
{
//ResponseBytes ::= SEQUENCE {
// responseType OBJECT IDENTIFIER,
// response OCTET STRING }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
new in_window.org.pkijs.asn1.OID({ name: (names.responseType || "") }),
new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.response || "") })
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.OCSP_RESPONSE =
function()
{
//OCSPResponse ::= SEQUENCE {
// responseStatus OCSPResponseStatus,
// responseBytes [0] EXPLICIT ResponseBytes OPTIONAL }
//
//OCSPResponseStatus ::= ENUMERATED {
// successful (0), -- Response has valid confirmations
// malformedRequest (1), -- Illegal confirmation request
// internalError (2), -- Internal error in issuer
// tryLater (3), -- Try again later
// -- (4) is not used
// sigRequired (5), -- Must sign the request
// unauthorized (6) -- Request unauthorized
//}
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || "OCSPResponse"),
value: [
new in_window.org.pkijs.asn1.ENUMERATED({ name: (names.responseStatus || "responseStatus") }),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [
in_window.org.pkijs.schema.ocsp.ResponseBytes(names.responseBytes || {
names: {
block_name: "responseBytes"
}
})
]
})
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.ocsp.SingleResponse =
function()
{
//SingleResponse ::= SEQUENCE {
// certID CertID,
// certStatus CertStatus,
// thisUpdate GeneralizedTime,
// nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
// singleExtensions [1] EXPLICIT Extensions OPTIONAL }
//
//CertStatus ::= CHOICE {
// good [0] IMPLICIT NULL,
// revoked [1] IMPLICIT RevokedInfo,
// unknown [2] IMPLICIT UnknownInfo }
//
//RevokedInfo ::= SEQUENCE {
// revocationTime GeneralizedTime,
// revocationReason [0] EXPLICIT CRLReason OPTIONAL }
//
//UnknownInfo ::= NULL
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
in_window.org.pkijs.schema.ocsp.CertID(names.certID || {}),
new in_window.org.pkijs.asn1.CHOICE({
value: [
new in_window.org.pkijs.asn1.ASN1_PRIMITIVE({
name: (names.certStatus || ""),
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
len_block_length: 1 // The length contains one byte 0x00
}), // IMPLICIT NULL (no "value_block")
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
name: (names.certStatus || ""),
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 1 // [1]
},
value: [
new in_window.org.pkijs.asn1.GENERALIZEDTIME(),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [new in_window.org.pkijs.asn1.ENUMERATED()]
})
]
}),
new in_window.org.pkijs.asn1.ASN1_PRIMITIVE({
name: (names.certStatus || ""),
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 2 // [2]
},
len_block: { length: 1 }
}) // IMPLICIT NULL (no "value_block")
]
}),
new in_window.org.pkijs.asn1.GENERALIZEDTIME({ name: (names.thisUpdate || "") }),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [new in_window.org.pkijs.asn1.GENERALIZEDTIME({ name: (names.nextUpdate || "") })]
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 1 // [1]
},
value: [in_window.org.pkijs.schema.EXTENSIONS(names.singleExtensions || {})]
}) // EXPLICIT SEQUENCE value
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.ocsp.ResponseData =
function()
{
//ResponseData ::= SEQUENCE {
// version [0] EXPLICIT Version DEFAULT v1,
// responderID ResponderID,
// producedAt GeneralizedTime,
// responses SEQUENCE OF SingleResponse,
// responseExtensions [1] EXPLICIT Extensions OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || "ResponseData"),
value: [
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [new in_window.org.pkijs.asn1.INTEGER({ name: (names.version || "ResponseData.version") })]
}),
new in_window.org.pkijs.asn1.CHOICE({
value: [
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
name: (names.responderID || "ResponseData.responderID"),
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 1 // [1]
},
value: [in_window.org.pkijs.schema.RDN(names.ResponseData_byName || {
names: {
block_name: "ResponseData.byName"
}
})]
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
name: (names.responderID || "ResponseData.responderID"),
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 2 // [2]
},
value: [new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.ResponseData_byKey || "ResponseData.byKey") })]
})
]
}),
new in_window.org.pkijs.asn1.GENERALIZEDTIME({ name: (names.producedAt || "ResponseData.producedAt") }),
new in_window.org.pkijs.asn1.SEQUENCE({
value: [
new in_window.org.pkijs.asn1.REPEATED({
name: "ResponseData.responses",
value: in_window.org.pkijs.schema.ocsp.SingleResponse(names.response || {})
})
]
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 1 // [1]
},
value: [in_window.org.pkijs.schema.EXTENSIONS(names.extensions || {
names: {
block_name: "ResponseData.responseExtensions"
}
})]
}) // EXPLICIT SEQUENCE value
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.OCSP_BASIC_RESPONSE =
function()
{
//BasicOCSPResponse ::= SEQUENCE {
// tbsResponseData ResponseData,
// signatureAlgorithm AlgorithmIdentifier,
// signature BIT STRING,
// certs [0] EXPLICIT SEQUENCE OF Certificate OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || "BasicOCSPResponse"),
value: [
in_window.org.pkijs.schema.ocsp.ResponseData(names.tbsResponseData || {
names: {
block_name: "BasicOCSPResponse.tbsResponseData"
}
}),
in_window.org.pkijs.schema.ALGORITHM_IDENTIFIER(names.signatureAlgorithm || {
names: {
block_name: "BasicOCSPResponse.signatureAlgorithm"
}
}),
new in_window.org.pkijs.asn1.BITSTRING({ name: (names.signature || "BasicOCSPResponse.signature") }),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [
new in_window.org.pkijs.asn1.SEQUENCE({
value: [new in_window.org.pkijs.asn1.REPEATED({
name: "BasicOCSPResponse.certs",
value: in_window.org.pkijs.schema.CERT(names.certs || {})
})]
})
]
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for Time-stamp request type (RFC3161)
//**************************************************************************************
in_window.org.pkijs.schema.tsp.MessageImprint =
function()
{
//MessageImprint ::= SEQUENCE {
// hashAlgorithm AlgorithmIdentifier,
// hashedMessage OCTET STRING }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
in_window.org.pkijs.schema.ALGORITHM_IDENTIFIER(names.hashAlgorithm || {}),
new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.hashedMessage || "") })
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.TSP_REQUEST =
function()
{
//TimeStampReq ::= SEQUENCE {
// version INTEGER { v1(1) },
// messageImprint MessageImprint,
// reqPolicy TSAPolicyId OPTIONAL,
// nonce INTEGER OPTIONAL,
// certReq BOOLEAN DEFAULT FALSE,
// extensions [0] IMPLICIT Extensions OPTIONAL }
//
//TSAPolicyId ::= OBJECT IDENTIFIER
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || "TimeStampReq"),
value: [
new in_window.org.pkijs.asn1.INTEGER({ name: (names.version || "TimeStampReq.version") }),
in_window.org.pkijs.schema.tsp.MessageImprint(names.messageImprint || {
names: {
block_name: "TimeStampReq.messageImprint"
}
}),
new in_window.org.pkijs.asn1.OID({
name: (names.reqPolicy || "TimeStampReq.reqPolicy"),
optional: true
}),
new in_window.org.pkijs.asn1.INTEGER({
name: (names.nonce || "TimeStampReq.nonce"),
optional: true
}),
new in_window.org.pkijs.asn1.BOOLEAN({
name: (names.certReq || "TimeStampReq.certReq"),
optional: true
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [new in_window.org.pkijs.asn1.REPEATED({
name: (names.extensions || "TimeStampReq.extensions"),
value: in_window.org.pkijs.schema.EXTENSION()
})]
}) // IMPLICIT SEQUENCE value
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for Time-stamp response (RFC3161)
//**************************************************************************************
in_window.org.pkijs.schema.tsp.Accuracy =
function()
{
//Accuracy ::= SEQUENCE {
// seconds INTEGER OPTIONAL,
// millis [0] INTEGER (1..999) OPTIONAL,
// micros [1] INTEGER (1..999) OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
optional: true,
value: [
new in_window.org.pkijs.asn1.INTEGER({
optional: true,
name: (names.seconds || "")
}),
new in_window.org.pkijs.asn1.ASN1_PRIMITIVE({
name: (names.millis || ""),
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
}
}),
new in_window.org.pkijs.asn1.ASN1_PRIMITIVE({
name: (names.micros || ""),
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 1 // [1]
}
})
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.TST_INFO =
function()
{
//TSTInfo ::= SEQUENCE {
// version INTEGER { v1(1) },
// policy TSAPolicyId,
// messageImprint MessageImprint,
// serialNumber INTEGER,
// genTime GeneralizedTime,
// accuracy Accuracy OPTIONAL,
// ordering BOOLEAN DEFAULT FALSE,
// nonce INTEGER OPTIONAL,
// tsa [0] GeneralName OPTIONAL,
// extensions [1] IMPLICIT Extensions OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || "TSTInfo"),
value: [
new in_window.org.pkijs.asn1.INTEGER({ name: (names.version || "TSTInfo.version") }),
new in_window.org.pkijs.asn1.OID({ name: (names.policy || "TSTInfo.policy") }),
in_window.org.pkijs.schema.tsp.MessageImprint(names.messageImprint || {
names: {
block_name: "TSTInfo.messageImprint"
}
}),
new in_window.org.pkijs.asn1.INTEGER({ name: (names.serialNumber || "TSTInfo.serialNumber") }),
new in_window.org.pkijs.asn1.GENERALIZEDTIME({ name: (names.genTime || "TSTInfo.genTime") }),
in_window.org.pkijs.schema.tsp.Accuracy(names.accuracy || {
names: {
block_name: "TSTInfo.accuracy"
}
}),
new in_window.org.pkijs.asn1.BOOLEAN({
name: (names.ordering || "TSTInfo.ordering"),
optional: true
}),
new in_window.org.pkijs.asn1.INTEGER({
name: (names.nonce || "TSTInfo.nonce"),
optional: true
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [in_window.org.pkijs.schema.GENERAL_NAME(names.tsa || {
names: {
block_name: "TSTInfo.tsa"
}
})]
}),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
optional: true,
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 1 // [1]
},
value: [
new in_window.org.pkijs.asn1.REPEATED({
name: (names.extensions || "TSTInfo.extensions"),
value: in_window.org.pkijs.schema.EXTENSION(names.extension || {})
})
]
}) // IMPLICIT Extensions
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.tsp.PKIStatusInfo =
function()
{
//PKIStatusInfo ::= SEQUENCE {
// status PKIStatus,
// statusString PKIFreeText OPTIONAL,
// failInfo PKIFailureInfo OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
new in_window.org.pkijs.asn1.INTEGER({ name: (names.status || "") }),
new in_window.org.pkijs.asn1.SEQUENCE({
optional: true,
value: [
new in_window.org.pkijs.asn1.REPEATED({
name: (names.statusStrings || ""),
value: new in_window.org.pkijs.asn1.UTF8STRING()
})
]
}),
new in_window.org.pkijs.asn1.BITSTRING({
name: (names.failInfo || ""),
optional: true
})
]
}));
};
//**************************************************************************************
in_window.org.pkijs.schema.TSP_RESPONSE =
function()
{
//TimeStampResp ::= SEQUENCE {
// status PKIStatusInfo,
// timeStampToken TimeStampToken OPTIONAL }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || "TimeStampResp"),
value: [
in_window.org.pkijs.schema.tsp.PKIStatusInfo(names.status || {
names: {
block_name: "TimeStampResp.status"
}
}),
in_window.org.pkijs.schema.CMS_CONTENT_INFO(names.timeStampToken || {
names: {
block_name: "TimeStampResp.timeStampToken"
}
}, true)
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
}
)(typeof exports !== "undefined" ? exports : window);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,413 @@
/*
* Copyright (c) 2015, Peculiar Ventures
* All rights reserved.
*
* Author 2015, Yury Strozhevsky <www.strozhevsky.com>.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
*/
(
function(in_window)
{
//**************************************************************************************
// #region Declaration of global variables
//**************************************************************************************
// #region "org" namespace
if(typeof in_window.org === "undefined")
in_window.org = {};
else
{
if(typeof in_window.org !== "object")
throw new Error("Name org already exists and it's not an object");
}
// #endregion
// #region "org.pkijs" namespace
if(typeof in_window.org.pkijs === "undefined")
in_window.org.pkijs = {};
else
{
if(typeof in_window.org.pkijs !== "object")
throw new Error("Name org.pkijs already exists and it's not an object" + " but " + (typeof in_window.org.pkijs));
}
// #endregion
// #region "org.pkijs.schema" namespace
if(typeof in_window.org.pkijs.schema === "undefined")
in_window.org.pkijs.schema = {};
else
{
if(typeof in_window.org.pkijs.schema !== "object")
throw new Error("Name org.pkijs.schema already exists and it's not an object" + " but " + (typeof in_window.org.pkijs.schema));
}
// #endregion
// #region "org.pkijs.schema.cms" namespace
if(typeof in_window.org.pkijs.schema.pkcs12 === "undefined")
in_window.org.pkijs.schema.pkcs12 = {};
else
{
if(typeof in_window.org.pkijs.schema.pkcs12 !== "object")
throw new Error("Name org.pkijs.schema.pkcs12 already exists and it's not an object" + " but " + (typeof in_window.org.pkijs.schema.pkcs12));
}
// #endregion
// #region "local" namespace
var local = {};
// #endregion
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "DigestInfo" type (RFC2315)
//**************************************************************************************
in_window.org.pkijs.schema.DigestInfo =
function()
{
//DigestInfo ::= SEQUENCE {
// digestAlgorithm DigestAlgorithmIdentifier,
// digest Digest }
//Digest ::= OCTET STRING
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
in_window.org.pkijs.schema.ALGORITHM_IDENTIFIER(names.digestAlgorithm || {
names: {
block_name: "digestAlgorithm"
}
}),
new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.digest || "digest") })
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "MacData" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.MacData =
function()
{
//MacData ::= SEQUENCE {
// mac DigestInfo,
// macSalt OCTET STRING,
// iterations INTEGER DEFAULT 1
// -- Note: The default is for historical reasons and its use is
// -- deprecated. A higher value, like 1024 is recommended.
// }
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
optional: (names.optional || true),
value: [
in_window.org.pkijs.schema.DigestInfo(names.mac || {
names: {
block_name: "mac"
}
}),
new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.macSalt || "macSalt") }),
new in_window.org.pkijs.asn1.INTEGER({
optional: true,
name: (names.iterations || "iterations")
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "PFX" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.PFX =
function()
{
//PFX ::= SEQUENCE {
// version INTEGER {v3(3)}(v3,...),
// authSafe ContentInfo,
// macData MacData OPTIONAL
//}
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
new in_window.org.pkijs.asn1.INTEGER({ name: (names.version || "version") }),
in_window.org.pkijs.schema.CMS_CONTENT_INFO(names.authSafe || {
names: {
block_name: "authSafe"
}
}),
in_window.org.pkijs.schema.pkcs12.MacData(names.macData || {
names: {
block_name: "macData",
optional: true
}
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "AuthenticatedSafe" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.AuthenticatedSafe =
function()
{
//AuthenticatedSafe ::= SEQUENCE OF ContentInfo
//-- Data if unencrypted
//-- EncryptedData if password-encrypted
//-- EnvelopedData if public key-encrypted
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
new in_window.org.pkijs.asn1.REPEATED({
name: (names.contentInfos || ""),
value: in_window.org.pkijs.schema.CMS_CONTENT_INFO()
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "SafeBag" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.SafeBag =
function()
{
//SafeBag ::= SEQUENCE {
// bagId BAG-TYPE.&id ({PKCS12BagSet}),
// bagValue [0] EXPLICIT BAG-TYPE.&Type({PKCS12BagSet}{@bagId}),
// bagAttributes SET OF PKCS12Attribute OPTIONAL
//}
//rsadsi OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) rsadsi(113549)}
//pkcs OBJECT IDENTIFIER ::= {rsadsi pkcs(1)}
//pkcs-12 OBJECT IDENTIFIER ::= {pkcs 12}
//bagtypes OBJECT IDENTIFIER ::= {pkcs-12 10 1}
//keyBag BAG-TYPE ::=
//{KeyBag IDENTIFIED BY {bagtypes 1}}
//pkcs8ShroudedKeyBag BAG-TYPE ::=
//{PKCS8ShroudedKeyBag IDENTIFIED BY {bagtypes 2}}
//certBag BAG-TYPE ::=
//{CertBag IDENTIFIED BY {bagtypes 3}}
//crlBag BAG-TYPE ::=
//{CRLBag IDENTIFIED BY {bagtypes 4}}
//secretBag BAG-TYPE ::=
//{SecretBag IDENTIFIED BY {bagtypes 5}}
//safeContentsBag BAG-TYPE ::=
//{SafeContents IDENTIFIED BY {bagtypes 6}}
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
new in_window.org.pkijs.asn1.OID({ name: (names.bagId || "bagId") }),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [new in_window.org.pkijs.asn1.ANY({ name: (names.bagValue || "bagValue") })] // EXPLICIT ANY value
}),
new in_window.org.pkijs.asn1.SET({
optional: true,
value: [
new in_window.org.pkijs.asn1.REPEATED({
name: (names.bagAttributes || "bagAttributes"),
value: in_window.org.pkijs.schema.cms.Attribute()
})
]
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "SafeContents" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.SafeContents =
function()
{
//SafeContents ::= SEQUENCE OF SafeBag
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
new in_window.org.pkijs.asn1.REPEATED({
name: (names.safeBags || ""),
value: in_window.org.pkijs.schema.pkcs12.SafeBag()
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "KeyBag" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.KeyBag =
function()
{
return in_window.org.pkijs.schema.PKCS8.apply(null, arguments);
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "PKCS8ShroudedKeyBag" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.PKCS8ShroudedKeyBag =
function()
{
//PKCS8ShroudedKeyBag ::= EncryptedPrivateKeyInfo
//EncryptedPrivateKeyInfo ::= SEQUENCE {
// encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
// encryptedData EncryptedData
//}
//EncryptedData ::= OCTET STRING
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
in_window.org.pkijs.schema.ALGORITHM_IDENTIFIER(names.hashAlgorithm || {
names: {
block_name: "encryptionAlgorithm"
}
}),
new in_window.org.pkijs.asn1.CHOICE({
value: [
new in_window.org.pkijs.asn1.OCTETSTRING({ name: (names.encryptedData || "encryptedData") }),
new in_window.org.pkijs.asn1.OCTETSTRING({
id_block: {
is_constructed: true
},
name: (names.encryptedData || "encryptedData")
})
]
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "local.StandardBag" type
//**************************************************************************************
local.StandardBag =
function()
{
//SEQUENCE {
// certId BAG-TYPE.&id ({CertTypes}),
// certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId})
//}
var names = in_window.org.pkijs.getNames(arguments[0]);
return (new in_window.org.pkijs.asn1.SEQUENCE({
name: (names.block_name || ""),
value: [
new in_window.org.pkijs.asn1.OID({ name: (names.id || "id") }),
new in_window.org.pkijs.asn1.ASN1_CONSTRUCTED({
id_block: {
tag_class: 3, // CONTEXT-SPECIFIC
tag_number: 0 // [0]
},
value: [new in_window.org.pkijs.asn1.ANY({ name: (names.value || "value") })] // EXPLICIT ANY value
})
]
}));
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "CertBag" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.CertBag =
function()
{
//CertBag ::= SEQUENCE {
// certId BAG-TYPE.&id ({CertTypes}),
// certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId})
//}
return local.StandardBag.apply(null, arguments);
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "CRLBag" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.CRLBag =
function()
{
//CRLBag ::= SEQUENCE {
// crlId BAG-TYPE.&id ({CRLTypes}),
// crlValue [0] EXPLICIT BAG-TYPE.&Type ({CRLTypes}{@crlId})
//}
return local.StandardBag.apply(null, arguments);
};
//**************************************************************************************
// #endregion
//**************************************************************************************
// #region ASN.1 schema definition for "SecretBag" type (RFC7292)
//**************************************************************************************
in_window.org.pkijs.schema.pkcs12.SecretBag =
function()
{
//SecretBag ::= SEQUENCE {
// secretTypeId BAG-TYPE.&id ({SecretTypes}),
// secretValue [0] EXPLICIT BAG-TYPE.&Type ({SecretTypes}{@secretTypeId})
//}
return local.StandardBag.apply(null, arguments);
};
//**************************************************************************************
// #endregion
//**************************************************************************************
}
)(typeof exports !== "undefined" ? exports : window);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

7301
express-server/node_modules/pkijs/org/pkijs/x509_simpl.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

96
express-server/node_modules/pkijs/package.json generated vendored Normal file
View File

@ -0,0 +1,96 @@
{
"_args": [
[
"pkijs@^1.3.27",
"/nodeapps/https-test/greenlock-express.js/node_modules/certpem"
]
],
"_from": "pkijs@>=1.3.27 <2.0.0",
"_id": "pkijs@1.3.33",
"_inCache": true,
"_installable": true,
"_location": "/pkijs",
"_nodeVersion": "5.8.0",
"_npmOperationalInternal": {
"host": "packages-18-east.internal.npmjs.com",
"tmp": "tmp/pkijs-1.3.33.tgz_1479707633813_0.7746773960534483"
},
"_npmUser": {
"email": "yury@strozhevsky.com",
"name": "yury.strozhevsky"
},
"_npmVersion": "3.10.7",
"_phantomChildren": {},
"_requested": {
"name": "pkijs",
"raw": "pkijs@^1.3.27",
"rawSpec": "^1.3.27",
"scope": null,
"spec": ">=1.3.27 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/certpem"
],
"_resolved": "https://registry.npmjs.org/pkijs/-/pkijs-1.3.33.tgz",
"_shasum": "a689ef62113b7c348e1ffc09965d2239e5bb4c92",
"_shrinkwrap": null,
"_spec": "pkijs@^1.3.27",
"_where": "/nodeapps/https-test/greenlock-express.js/node_modules/certpem",
"author": {
"email": "yury@strozhevsky.com",
"name": "Yury Strozhevsky"
},
"bugs": {
"url": "https://github.com/GlobalSign/PKI.js/issues"
},
"contributors": [
{
"name": "Ryan Hurst",
"email": "rmh@unmitigatedrisk.com"
}
],
"dependencies": {},
"description": "Public Key Infrastructure (PKI) is the basis of how identity and key management is performed on the web today. PKIjs is a pure JavaScript library implementing the formats that are used in PKI applications. It is built on WebCrypto and aspires to make it p",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "a689ef62113b7c348e1ffc09965d2239e5bb4c92",
"tarball": "http://registry.npmjs.org/pkijs/-/pkijs-1.3.33.tgz"
},
"gitHead": "41b63af760cacb565dd850fb3466ada4ca163eff",
"homepage": "https://github.com/GlobalSign/PKI.js#readme",
"keywords": [
"OCSP",
"PKCS",
"Web Cryptography API",
"WebCrypto",
"X.509",
"certificate",
"cms",
"crl",
"encrypted",
"enveloped",
"timestamp"
],
"main": "org/pkijs/x509_simpl.js",
"maintainers": [
{
"name": "peculiarventures",
"email": "info@peculiarventures.com"
},
{
"name": "yury.strozhevsky",
"email": "yury@strozhevsky.com"
}
],
"name": "pkijs",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/GlobalSign/PKI.js.git"
},
"scripts": {},
"version": "1.3.33"
}