Skip to content

Conversation

@romanett
Copy link
Contributor

Proposed changes

This PR extends the directory store to check for PEM Public Keys (Up to 99 per file).
Private keys are also detected if they are in the same file or in the private folder.
If multiple Certs are contained in the same file, the file is deleted once no public keys are contained, also a private key file with the same name is removed once no Public keys are left.

PEMReader & PEMWriter are extended to deliver the needed functionality.

Tests are added for DirectoryStore & PEMReader.

Related Issues

  • Fixes #

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

@romanett romanett requested review from marcschier and mrsuciu June 10, 2025 05:58
@romanett romanett self-assigned this Jun 10, 2025
@romanett romanett changed the title Implement Support for PEM Public Keys in Directory Store Implement Support for PEM Public Keys in Directory Certificate Store Jun 10, 2025
@codecov
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 79.12088% with 38 lines in your changes missing coverage. Please review.

Project coverage is 57.43%. Comparing base (bd6c91d) to head (6ca3540).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...Security/Certificates/DirectoryCertificateStore.cs 83.03% 9 Missing and 10 partials ⚠️
...ries/Opc.Ua.Security.Certificates/PEM/PEMWriter.cs 66.66% 5 Missing and 5 partials ⚠️
...ries/Opc.Ua.Security.Certificates/PEM/PEMReader.cs 77.50% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3088      +/-   ##
==========================================
+ Coverage   57.42%   57.43%   +0.01%     
==========================================
  Files         357      357              
  Lines       69117    69220     +103     
  Branches    14203    14222      +19     
==========================================
+ Hits        39687    39756      +69     
- Misses      25180    25198      +18     
- Partials     4250     4266      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@mrsuciu mrsuciu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@mrsuciu mrsuciu merged commit 40b9dbb into OPCFoundation:master Jul 25, 2025
77 checks passed
@romanett romanett deleted the feat/PEMSupport branch August 4, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants