Skip to content

Commit be3a2aa

Browse files
committed
[UPD] rel v4.1.0
1 parent 7662138 commit be3a2aa

14 files changed

Lines changed: 87 additions & 18 deletions

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
4242
- name: Start OPC UA test servers
4343
id: opcua
44-
uses: php-opcua/uanetstandard-test-suite@v1.0.0
44+
uses: php-opcua/uanetstandard-test-suite@v1.1.0
4545

4646
- name: Run tests
4747
env:

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## [4.1.0] - 2026-04-13
4+
5+
### Added
6+
7+
- **ECC security policy support.** `security_policy` config key now accepts `ECC_nistP256`, `ECC_nistP384`, `ECC_brainpoolP256r1`, and `ECC_brainpoolP384r1` in addition to the existing 6 RSA policies. Added to `resolveSecurityPolicyUri()` in both `OpcuaManager` and `SessionCommand`. No `client_certificate`/`client_key` needed — ECC certificates are auto-generated when omitted. Username/password authentication uses the `EccEncryptedSecret` protocol automatically.
8+
- **ECC disclaimer:** No commercial OPC UA vendor supports ECC endpoints yet. This implementation is tested exclusively against the OPC Foundation's UA-.NETStandard reference stack.
9+
10+
### Changed
11+
12+
- Bumped minimum `php-opcua/opcua-client` dependency from `^4.0.0` to `^4.1` and `php-opcua/opcua-session-manager` from `^4.0.3` to `^4.1`.
13+
- Security support expanded from 6 to **10 policies** (6 RSA + 4 ECC).
14+
- Updated CI test server suite from `php-opcua/uanetstandard-test-suite@v1.0.0` to `@v1.1.0`.
15+
- Updated `config/opcua.php` security policy comment to list all 10 available policies including ECC.
16+
- Updated documentation (README, doc/07-security.md, doc/09-examples.md, llms.txt, llms-full.txt, llms-skills.md) to reflect ECC support, add ECC `.env` examples, and include the ECC disclaimer.
17+
318
## [4.0.1] - 2026-04-09
419

520
### Added

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ composer require php-opcua/laravel-opcua
5656
```
5757

5858
```dotenv
59+
# RSA security (or use ECC: ECC_nistP256, ECC_nistP384, ECC_brainpoolP256r1, ECC_brainpoolP384r1)
5960
OPCUA_ENDPOINT=opc.tcp://192.168.1.100:4840
6061
```
6162

@@ -255,7 +256,9 @@ echo $mock->callCount('read'); // 1
255256
| **Auto-Batching** | `readMulti`/`writeMulti` transparently split when exceeding server limits |
256257
| **Recursive Browse** | `browseAll()`, `browseRecursive()` with depth control and cycle detection |
257258
| **Path Resolution** | `resolveNodeId('/Objects/Server/ServerStatus')` |
258-
| **Security** | 6 policies, 3 auth modes, auto-generated certs, certificate trust management |
259+
| **Security** | 10 policies (RSA + ECC), 3 auth modes, auto-generated certs, certificate trust management |
260+
261+
> **ECC disclaimer:** ECC security policies (`ECC_nistP256`, `ECC_nistP384`, `ECC_brainpoolP256r1`, `ECC_brainpoolP384r1`) are fully implemented and tested against the OPC Foundation's UA-.NETStandard reference stack. However, no commercial OPC UA vendor supports ECC endpoints yet. When using ECC, client certificates are auto-generated if `client_certificate`/`client_key` are omitted, and username/password authentication uses the `EccEncryptedSecret` protocol automatically.
259262
| **History Read** | Raw, processed, and at-time historical queries |
260263
| **Typed Returns** | All service responses return `public readonly` DTOs |
261264

@@ -276,7 +279,7 @@ echo $mock->callCount('read'); // 1
276279

277280
## Testing
278281

279-
80+ unit tests with **99%+ code coverage**. Integration tests run against [uanetstandard-test-suite](https://github.com/php-opcua/uanetstandard-test-suite) — a Docker-based OPC UA environment built on the OPC Foundation's UA-.NETStandard reference implementation — in both direct and managed (daemon) modes.
282+
146+ unit tests with **99%+ code coverage**. Integration tests run against [uanetstandard-test-suite](https://github.com/php-opcua/uanetstandard-test-suite) — a Docker-based OPC UA environment built on the OPC Foundation's UA-.NETStandard reference implementation — in both direct and managed (daemon) modes.
280283

281284
```bash
282285
./vendor/bin/pest tests/Unit/ # unit only

ROADMAP.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> **A note on versioning:** We're aware of the rapid major releases in a short time frame. This library is under active, full-time development right now — the goal is to reach a production-stable state as quickly as possible. Breaking changes are being bundled and shipped deliberately to avoid dragging them out across many minor releases. Once the API surface settles, major version bumps will become rare. Thanks for your patience.
44
5-
## v4.0.0
5+
## Planned
66

77
### Features
88

@@ -21,6 +21,13 @@
2121
- [ ] Middleware — `EnsureOpcuaConnected` middleware that guarantees a live connection for the duration of the request and disconnects in `terminate()`
2222
- [ ] Lazy proxy — return a lazy proxy from `connection()` that defers the actual TCP/IPC handshake until the first operation, reducing boot overhead when the connection may not be needed
2323

24+
## Completed in v4.1.0
25+
26+
- [x] **ECC security policy support**`security_policy` config key accepts `ECC_nistP256`, `ECC_nistP384`, `ECC_brainpoolP256r1`, `ECC_brainpoolP384r1`
27+
- [x] ECC mapping in both `OpcuaManager::resolveSecurityPolicyUri()` and `SessionCommand::resolveSecurityPolicyUri()`
28+
- [x] Security support expanded from 6 to **10 policies** (6 RSA + 4 ECC)
29+
- [x] Updated all documentation and AI-ready files
30+
2431
## Won't Do (by design)
2532

2633
### Merge opcua-client or session-manager code

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
],
1212
"require": {
1313
"php": "^8.2",
14-
"php-opcua/opcua-client": "^4.0.0",
15-
"php-opcua/opcua-session-manager": "^4.0.3",
14+
"php-opcua/opcua-client": "^4.1",
15+
"php-opcua/opcua-session-manager": "^4.1",
1616
"psr/event-dispatcher": "^1.0",
1717
"illuminate/support": "^11.0|^12.0|^13.0",
1818
"illuminate/console": "^11.0|^12.0|^13.0",

config/opcua.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
'endpoint' => env('OPCUA_ENDPOINT', 'opc.tcp://localhost:4840'),
6868

6969
// Security (optional)
70-
'security_policy' => env('OPCUA_SECURITY_POLICY','None'), // None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128Sha256RsaOaep, Aes256Sha256RsaPss
70+
'security_policy' => env('OPCUA_SECURITY_POLICY','None'), // None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128Sha256RsaOaep, Aes256Sha256RsaPss, ECC_nistP256, ECC_nistP384, ECC_brainpoolP256r1, ECC_brainpoolP384r1
7171
'security_mode' => env('OPCUA_SECURITY_MODE','None'), // None, Sign, SignAndEncrypt
7272

7373
// User authentication (optional)

doc/02-installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Each connection can have its own endpoint, security settings, and credentials:
102102
| Key | Default | Description |
103103
|-----|---------|-------------|
104104
| `endpoint` | `opc.tcp://localhost:4840` | OPC UA server URL |
105-
| `security_policy` | `None` | Security policy name or URI |
105+
| `security_policy` | `None` | Security policy name or URI (see [Security](07-security.md) for all 10 policies including ECC) |
106106
| `security_mode` | `None` | `None`, `Sign`, or `SignAndEncrypt` |
107107
| `username` / `password` | `null` | Username/password authentication |
108108
| `client_certificate` / `client_key` | `null` | Client certificate (auto-generated if omitted) |

doc/07-security.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ Each policy defines the algorithms used for encryption and signing:
1212
| Basic256Sha256 | RSA-SHA256 | RSA-OAEP | HMAC-SHA256 | AES-256-CBC | 2048 bit |
1313
| Aes128Sha256RsaOaep | RSA-SHA256 | RSA-OAEP | HMAC-SHA256 | AES-128-CBC | 2048 bit |
1414
| Aes256Sha256RsaPss | RSA-PSS-SHA256 | RSA-OAEP-SHA256 | HMAC-SHA256 | AES-256-CBC | 2048 bit |
15+
| ECC_nistP256 | ECDSA-SHA256 | ECDH (P-256) | HMAC-SHA256 | AES-128-CBC | P-256 |
16+
| ECC_nistP384 | ECDSA-SHA384 | ECDH (P-384) | HMAC-SHA384 | AES-256-CBC | P-384 |
17+
| ECC_brainpoolP256r1 | ECDSA-SHA256 | ECDH (BP-256) | HMAC-SHA256 | AES-128-CBC | BP-256 |
18+
| ECC_brainpoolP384r1 | ECDSA-SHA384 | ECDH (BP-384) | HMAC-SHA384 | AES-256-CBC | BP-384 |
1519

16-
> **Tip:** For new deployments, use `Basic256Sha256` or `Aes256Sha256RsaPss`. The older policies (`Basic128Rsa15`, `Basic256`) exist for legacy server compatibility.
20+
> **Tip:** For new deployments, use `Basic256Sha256`, `Aes256Sha256RsaPss`, or one of the ECC policies. ECC policies use Elliptic Curve Diffie-Hellman for key agreement and HKDF for key derivation instead of RSA encryption — they offer equivalent security with smaller keys and faster handshakes. The older policies (`Basic128Rsa15`, `Basic256`) exist for legacy server compatibility.
1721
1822
## Security Modes
1923

@@ -109,7 +113,7 @@ openssl x509 -req -in client.csr -CA ca.pem -CAkey ca.key \
109113
110114
### Auto-Generated Certificates
111115

112-
When a security policy and mode are configured but no `client_certificate` / `client_key` are provided, the underlying client automatically generates a self-signed RSA 2048 certificate in memory with proper OPC UA extensions.
116+
When a security policy and mode are configured but no `client_certificate` / `client_key` are provided, the underlying client automatically generates a self-signed certificate in memory with proper OPC UA extensions. For RSA policies, a 2048-bit RSA certificate is generated. For ECC policies, an EC certificate matching the policy's curve (NIST P-256/P-384 or Brainpool P-256/P-384) is generated.
113117

114118
```php
115119
'connections' => [
@@ -164,7 +168,7 @@ The `security_policy` config key accepts both short names and full OPC UA URIs:
164168
'security_policy' => 'http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256',
165169
```
166170

167-
Supported short names: `None`, `Basic128Rsa15`, `Basic256`, `Basic256Sha256`, `Aes128Sha256RsaOaep`, `Aes256Sha256RsaPss`.
171+
Supported short names: `None`, `Basic128Rsa15`, `Basic256`, `Basic256Sha256`, `Aes128Sha256RsaOaep`, `Aes256Sha256RsaPss`, `ECC_nistP256`, `ECC_nistP384`, `ECC_brainpoolP256r1`, `ECC_brainpoolP384r1`.
168172

169173
## Mode Resolution
170174

@@ -206,7 +210,7 @@ Client Server
206210

207211
**Phase 1 — Discovery.** The client connects without security, calls `GetEndpoints`, and retrieves the server's certificate.
208212

209-
**Phase 2 — Asymmetric (OpenSecureChannel).** The client sends an OPN request encrypted with the server's public key. Both sides exchange nonces. Symmetric keys are derived from the shared nonces.
213+
**Phase 2 — Asymmetric (OpenSecureChannel).** For RSA policies, the client sends an OPN request encrypted with the server's public key; both sides exchange nonces and derive symmetric keys via P_SHA. For ECC policies, the OPN is signed (not encrypted) with ECDSA; both sides exchange ephemeral EC public keys and derive symmetric keys via ECDH + HKDF.
210214

211215
**Phase 3 — Symmetric (Session + Messages).** All subsequent messages (CreateSession, ActivateSession, Read, Write, etc.) use the derived symmetric keys — signed with HMAC and encrypted with AES-CBC.
212216

doc/09-examples.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,27 @@ echo $value->getValue();
301301
$client->disconnect();
302302
```
303303

304+
## ECC Secure Connection
305+
306+
```php
307+
use PhpOpcua\LaravelOpcua\Facades\Opcua;
308+
309+
// ECC security — no client certificate needed (auto-generated)
310+
$client = Opcua::connectTo('opc.tcp://10.0.0.10:4840', [
311+
'security_policy' => 'ECC_nistP256',
312+
'security_mode' => 'SignAndEncrypt',
313+
'username' => 'operator',
314+
'password' => 'secret',
315+
]);
316+
317+
$value = $client->read('ns=2;i=1001');
318+
echo $value->getValue();
319+
320+
$client->disconnect();
321+
```
322+
323+
> **ECC disclaimer:** ECC security policies (`ECC_nistP256`, `ECC_nistP384`, `ECC_brainpoolP256r1`, `ECC_brainpoolP384r1`) are fully implemented and tested against the OPC Foundation's UA-.NETStandard reference stack. No commercial OPC UA vendor supports ECC endpoints yet.
324+
304325
## Multiple Connections
305326

306327
```php

llms-full.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ New in v4.0.1 (per-connection):
5757
| Key | Default | Description |
5858
|-----|---------|-------------|
5959
| endpoint | opc.tcp://localhost:4840 | Server URL |
60-
| security_policy | None | None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128Sha256RsaOaep, Aes256Sha256RsaPss |
60+
| security_policy | None | None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128Sha256RsaOaep, Aes256Sha256RsaPss, ECC_nistP256, ECC_nistP384, ECC_brainpoolP256r1, ECC_brainpoolP384r1 |
6161
| security_mode | None | None, Sign, SignAndEncrypt |
6262
| username / password | null | User authentication |
6363
| client_certificate / client_key | null | Client cert (auto-generated if omitted) |
@@ -326,10 +326,10 @@ $repo = $client->getExtensionObjectRepository();
326326

327327
## Security
328328

329-
6 policies: None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128Sha256RsaOaep, Aes256Sha256RsaPss.
329+
10 policies: None, Basic128Rsa15, Basic256, Basic256Sha256, Aes128Sha256RsaOaep, Aes256Sha256RsaPss, ECC_nistP256, ECC_nistP384, ECC_brainpoolP256r1, ECC_brainpoolP384r1.
330330
3 modes: None, Sign, SignAndEncrypt.
331331
3 auth methods: Anonymous, Username/Password, X.509 Certificate.
332-
Auto-generated client certificates when policy/mode set but no cert provided.
332+
Auto-generated client certificates when policy/mode set but no cert provided (RSA 2048 for RSA policies, EC matching curve for ECC policies).
333333
Certificate trust management via FileTrustStore with configurable TrustPolicy.
334334

335335
## MockClient (Testing)

0 commit comments

Comments
 (0)