node-opcua-common 2.54.0 → 2.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/crypto_explore_certificate.js +1 -1
- package/fragments.yml +46 -46
- package/package.json +10 -10
- package/source/applicationurn.ts +23 -23
- package/source/index.ts +23 -23
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-2021 Etienne Rossignon
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-2021 Etienne Rossignon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
module.exports = require("node-opcua-crypto").crypto_explore_certificate;
|
|
1
|
+
module.exports = require("node-opcua-crypto").crypto_explore_certificate;
|
package/fragments.yml
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
#
|
|
2
|
-
ApplicationInstanceCertificate:
|
|
3
|
-
reference: OPC Unified Architecture, Part 4 page 106
|
|
4
|
-
documentation: ApplicationInstanceCertificate with signature created by a Certificate Authority
|
|
5
|
-
fields:
|
|
6
|
-
version: An identifier for the version of the Certificate encoding.
|
|
7
|
-
serialNumber: A unique identifier for the Certificate assigned by the Issuer.
|
|
8
|
-
signatureAlgorithm: >
|
|
9
|
-
The algorithm used to sign the Certificate.
|
|
10
|
-
The syntax of this field depends on the Certificate encoding.
|
|
11
|
-
signature: The signature created by the Issuer.
|
|
12
|
-
issuer: A name that identifies the Issuer Certificate used to create the signature.
|
|
13
|
-
validFrom: When the Certificate becomes valid.
|
|
14
|
-
validTo: When the Certificate expires.
|
|
15
|
-
subject: >
|
|
16
|
-
A name that identifies the application instance that the Certificate describes.
|
|
17
|
-
This field shall contain the productName and the name of the organization
|
|
18
|
-
responsible for the application instance.
|
|
19
|
-
applicationUri: >
|
|
20
|
-
The applicationUri specified in the ApplicationDescription .
|
|
21
|
-
The ApplicationDescription is described in 7.1.
|
|
22
|
-
hostnames: >
|
|
23
|
-
The name of the machine where the application instance runs.
|
|
24
|
-
A machine may have multiple names if is accessible via multiple networks.
|
|
25
|
-
The hostname may be a numeric network address or a descriptive name.
|
|
26
|
-
Server Certificates shall have at least one hostname defined.
|
|
27
|
-
publicKey: The public key associated with the Certificate .
|
|
28
|
-
keyUsage: >
|
|
29
|
-
Specifies how the Certificate key may be used.
|
|
30
|
-
ApplicationInstanceCertificates shall support Digital Signature, Non-Repudiation Key Encryption,
|
|
31
|
-
Data Encryption and Client/Server Authorization.
|
|
32
|
-
The contents of this field depend on the Certificate encoding
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
#
|
|
36
|
-
BuildInfo:
|
|
37
|
-
documentation: Server build Info,
|
|
38
|
-
fields:
|
|
39
|
-
productUri: A description for the ProductUri Variable.
|
|
40
|
-
manufacturerName: the name of the manufacturer
|
|
41
|
-
productName: the product name"
|
|
42
|
-
softwareVersion: the software version
|
|
43
|
-
buildNumber: the software build number
|
|
44
|
-
buildDate: the software build date
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+
#
|
|
2
|
+
ApplicationInstanceCertificate:
|
|
3
|
+
reference: OPC Unified Architecture, Part 4 page 106
|
|
4
|
+
documentation: ApplicationInstanceCertificate with signature created by a Certificate Authority
|
|
5
|
+
fields:
|
|
6
|
+
version: An identifier for the version of the Certificate encoding.
|
|
7
|
+
serialNumber: A unique identifier for the Certificate assigned by the Issuer.
|
|
8
|
+
signatureAlgorithm: >
|
|
9
|
+
The algorithm used to sign the Certificate.
|
|
10
|
+
The syntax of this field depends on the Certificate encoding.
|
|
11
|
+
signature: The signature created by the Issuer.
|
|
12
|
+
issuer: A name that identifies the Issuer Certificate used to create the signature.
|
|
13
|
+
validFrom: When the Certificate becomes valid.
|
|
14
|
+
validTo: When the Certificate expires.
|
|
15
|
+
subject: >
|
|
16
|
+
A name that identifies the application instance that the Certificate describes.
|
|
17
|
+
This field shall contain the productName and the name of the organization
|
|
18
|
+
responsible for the application instance.
|
|
19
|
+
applicationUri: >
|
|
20
|
+
The applicationUri specified in the ApplicationDescription .
|
|
21
|
+
The ApplicationDescription is described in 7.1.
|
|
22
|
+
hostnames: >
|
|
23
|
+
The name of the machine where the application instance runs.
|
|
24
|
+
A machine may have multiple names if is accessible via multiple networks.
|
|
25
|
+
The hostname may be a numeric network address or a descriptive name.
|
|
26
|
+
Server Certificates shall have at least one hostname defined.
|
|
27
|
+
publicKey: The public key associated with the Certificate .
|
|
28
|
+
keyUsage: >
|
|
29
|
+
Specifies how the Certificate key may be used.
|
|
30
|
+
ApplicationInstanceCertificates shall support Digital Signature, Non-Repudiation Key Encryption,
|
|
31
|
+
Data Encryption and Client/Server Authorization.
|
|
32
|
+
The contents of this field depend on the Certificate encoding
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
#
|
|
36
|
+
BuildInfo:
|
|
37
|
+
documentation: Server build Info,
|
|
38
|
+
fields:
|
|
39
|
+
productUri: A description for the ProductUri Variable.
|
|
40
|
+
manufacturerName: the name of the manufacturer
|
|
41
|
+
productName: the product name"
|
|
42
|
+
softwareVersion: the software version
|
|
43
|
+
buildNumber: the software build number
|
|
44
|
+
buildDate: the software build date
|
|
45
|
+
|
|
46
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.57.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -common",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "mocha",
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
"main": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"node-opcua-assert": "2.
|
|
15
|
-
"node-opcua-basic-types": "2.
|
|
14
|
+
"node-opcua-assert": "2.55.0",
|
|
15
|
+
"node-opcua-basic-types": "2.57.0",
|
|
16
16
|
"node-opcua-crypto": "^1.7.4",
|
|
17
|
-
"node-opcua-data-model": "2.
|
|
18
|
-
"node-opcua-factory": "2.
|
|
19
|
-
"node-opcua-nodeid": "2.
|
|
20
|
-
"node-opcua-service-endpoints": "2.
|
|
21
|
-
"node-opcua-service-secure-channel": "2.
|
|
22
|
-
"node-opcua-types": "2.
|
|
17
|
+
"node-opcua-data-model": "2.57.0",
|
|
18
|
+
"node-opcua-factory": "2.57.0",
|
|
19
|
+
"node-opcua-nodeid": "2.55.0",
|
|
20
|
+
"node-opcua-service-endpoints": "2.57.0",
|
|
21
|
+
"node-opcua-service-secure-channel": "2.57.0",
|
|
22
|
+
"node-opcua-types": "2.57.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "16.10.1",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"internet of things"
|
|
41
41
|
],
|
|
42
42
|
"homepage": "http://node-opcua.github.io/",
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "cb6a995ab35ea6231ffca85fbd0b624fe37119d2"
|
|
44
44
|
}
|
package/source/applicationurn.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-common
|
|
3
|
-
*/
|
|
4
|
-
import * as crypto from "crypto";
|
|
5
|
-
|
|
6
|
-
import { assert } from "node-opcua-assert";
|
|
7
|
-
|
|
8
|
-
export function makeApplicationUrn(hostname: string, suffix: string): string {
|
|
9
|
-
assert(!suffix.match(/urn:/), "already a application URN ?");
|
|
10
|
-
// beware : Openssl doesn't support urn with length greater than 64 !!
|
|
11
|
-
// sometimes hostname length could be too long ...
|
|
12
|
-
// application urn length must not exceed 64 car. to comply with openssl
|
|
13
|
-
// see cryptoCA
|
|
14
|
-
let hostnameHash = hostname;
|
|
15
|
-
if (hostnameHash.length + 7 + suffix.length >= 64) {
|
|
16
|
-
// we need to reduce the applicationUrn side => let's take
|
|
17
|
-
// a portion of the hostname hash.
|
|
18
|
-
hostnameHash = crypto.createHash("md5").update(hostname).digest("hex").substr(0, 16);
|
|
19
|
-
}
|
|
20
|
-
const applicationUrn = "urn:" + hostnameHash + ":" + suffix;
|
|
21
|
-
assert(applicationUrn.length <= 64);
|
|
22
|
-
return applicationUrn;
|
|
23
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-common
|
|
3
|
+
*/
|
|
4
|
+
import * as crypto from "crypto";
|
|
5
|
+
|
|
6
|
+
import { assert } from "node-opcua-assert";
|
|
7
|
+
|
|
8
|
+
export function makeApplicationUrn(hostname: string, suffix: string): string {
|
|
9
|
+
assert(!suffix.match(/urn:/), "already a application URN ?");
|
|
10
|
+
// beware : Openssl doesn't support urn with length greater than 64 !!
|
|
11
|
+
// sometimes hostname length could be too long ...
|
|
12
|
+
// application urn length must not exceed 64 car. to comply with openssl
|
|
13
|
+
// see cryptoCA
|
|
14
|
+
let hostnameHash = hostname;
|
|
15
|
+
if (hostnameHash.length + 7 + suffix.length >= 64) {
|
|
16
|
+
// we need to reduce the applicationUrn side => let's take
|
|
17
|
+
// a portion of the hostname hash.
|
|
18
|
+
hostnameHash = crypto.createHash("md5").update(hostname).digest("hex").substr(0, 16);
|
|
19
|
+
}
|
|
20
|
+
const applicationUrn = "urn:" + hostnameHash + ":" + suffix;
|
|
21
|
+
assert(applicationUrn.length <= 64);
|
|
22
|
+
return applicationUrn;
|
|
23
|
+
}
|
package/source/index.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-common
|
|
3
|
-
*/
|
|
4
|
-
export {
|
|
5
|
-
ServerState,
|
|
6
|
-
ServerStatusDataType, // ServerStatus
|
|
7
|
-
RedundantServerDataType, // RedundantServer
|
|
8
|
-
ModelChangeStructureDataType, // ModelChangeStructure
|
|
9
|
-
SubscriptionDiagnosticsDataType, // SubscriptionDiagnostics
|
|
10
|
-
SamplingIntervalDiagnosticsDataType, // SamplingIntervalDiagnostics
|
|
11
|
-
SemanticChangeStructureDataType, // SemanticChangeStructure
|
|
12
|
-
ServerDiagnosticsSummaryDataType,
|
|
13
|
-
SessionSecurityDiagnosticsDataType,
|
|
14
|
-
ServiceCounterDataType,
|
|
15
|
-
SessionDiagnosticsDataType,
|
|
16
|
-
BuildInfo,
|
|
17
|
-
DataTypeDefinition,
|
|
18
|
-
EnumValueType,
|
|
19
|
-
TimeZoneDataType,
|
|
20
|
-
} from "node-opcua-types";
|
|
21
|
-
|
|
22
|
-
export * from "./applicationurn";
|
|
23
|
-
export * from "./opcua_secure_object";
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-common
|
|
3
|
+
*/
|
|
4
|
+
export {
|
|
5
|
+
ServerState,
|
|
6
|
+
ServerStatusDataType, // ServerStatus
|
|
7
|
+
RedundantServerDataType, // RedundantServer
|
|
8
|
+
ModelChangeStructureDataType, // ModelChangeStructure
|
|
9
|
+
SubscriptionDiagnosticsDataType, // SubscriptionDiagnostics
|
|
10
|
+
SamplingIntervalDiagnosticsDataType, // SamplingIntervalDiagnostics
|
|
11
|
+
SemanticChangeStructureDataType, // SemanticChangeStructure
|
|
12
|
+
ServerDiagnosticsSummaryDataType,
|
|
13
|
+
SessionSecurityDiagnosticsDataType,
|
|
14
|
+
ServiceCounterDataType,
|
|
15
|
+
SessionDiagnosticsDataType,
|
|
16
|
+
BuildInfo,
|
|
17
|
+
DataTypeDefinition,
|
|
18
|
+
EnumValueType,
|
|
19
|
+
TimeZoneDataType,
|
|
20
|
+
} from "node-opcua-types";
|
|
21
|
+
|
|
22
|
+
export * from "./applicationurn";
|
|
23
|
+
export * from "./opcua_secure_object";
|