Repository navigation
certificatePolicies extension on certificate profiles - #76
Merged
Merged
Conversation
A profile now carries a list of certificate policy OIDs (CertificatePolicyOids, semicolon-delimited like the extended key usages). Issued certificates carry them in a non-critical certificatePolicies extension (RFC 5280 section 4.2.1.4) on the local, CSR, remote-signing and hybrid paths. - CertificatePolicyExtension: parse, validate and normalize policy text, build the extension, and decode it (policy OIDs plus CPS / user notice qualifiers). - Profile editor: a Certificate Policies field with inline OID validation; clone copies the policies; the service refuses entries that are not OIDs. - Certificate viewer: the extension is decoded into its policy OIDs. - Renewal and re-key keep the predecessor's policies: a profile may add policies but not drop any. Compatible-profile filtering and the issuance service both enforce this. Re-sign already copies every extension. - Flyway V11 adds the CertificateProfiles.CertificatePolicyOids column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
JoeShook
force-pushed
the
feature/63-certificate-policies
branch
from
November 22, 2026 14:28
8547060 to
10ec481
Compare
Owner
Author
|
Decisions on the open questions:
No code changes needed here. |
JoeShook
marked this pull request as ready for review
November 22, 2026 15:43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #63
What changed
CertificateProfile.CertificatePolicyOidsholds semicolon-delimited policy OIDs. It uses the same storage convention asExtendedKeyUsageOids. If the field is null or empty, the extension is left out, so existing profiles issue the same certificates as before.certificatePoliciesextension (2.5.29.32, RFC 5280 §4.2.1.4) from the profile. Only the policy OIDs are written, with no qualifiers.CertificatePolicyExtension(new,Sigyll.Common/Services): a small static API meant to be reused by the preset work in TEFCA FHIR certificate presets (intermediate, client, server; production and validation) #62:Parse/Normalize/FindInvalid/IsValidOid: policy text accepts;,,, spaces or newlines as separators, and is stored joined with;.Build(IEnumerable<string>)/Build(string?)builds the extension (optionalcritical).Read(X509Certificate2)/Decode(X509Extension)/Describe(X509Extension)read it back, including CPS URI and user-notice qualifiers.CertificateProfileService.SaveAsyncnormalizes the list and throwsArgumentExceptionfor entries that are not OIDs.ExtensionTable): shows the decoded policy OIDs and their qualifiers, so the output is the same on every OS.X509Extension.Formatoutput depends on the platform.RenewalIdentity.IsCompatibleProfilefilters out profiles that would drop one.RenewalIdentity.FindDroppedPolicies.V11__certificate_policies.sqladdsCertificateProfiles.CertificatePolicyOids CHARACTER VARYING(2000). It passestools/sql-lint/check_sql.py.How it was tested
dotnet build Sigyll.slnx: succeeded.dotnet test _tests/Sigyll.Signing.Tests: 577 passed, 17 skipped (the existing PKCS Bump the microsoft group with 18 updates #11/SoftHSM skips), 0 failed.CertificatePolicyExtensionTests: OID validation, parsing and normalization; the DER output is read back by BouncyCastle; qualifier decoding; hex fallback; the profile service normalizes and refuses invalid entries.RenewalIdentityTests: the policies appear in the issued certificate (non-critical) and are kept on renewal; a renewal whose profile drops a policy is refused; issuance with an invalid policy is refused; the compatible-profile rules (adding a policy is allowed, dropping one is not).python tools/sql-lint/check_sql.py: 16 files, 0 problems.Open questions
CatalogProfile(portal) does not expose the policies yet. Should it?🤖 Generated with Claude Code