Repository navigation
Conversation
A certification (DocMDP) signature has to be the first signature of a document. With DocMDP enabled, the native engine certified every invisible signature, also on a document that was already signed or already certified, which invalidates the earlier signatures' DocMDP semantics. Certify only when the document has no signature yet, for invisible and visible signatures alike. Signed-off-by: no84by <50858621+no84by@users.noreply.github.com>
…nature The JSignPdf parameters are kept on the handler between signatures and new parameters are merged into them. After a certifying signature, the next signature made by the same handler (for example on a document that is already signed) still carried "-cl" and certified again. When DocMDP is enabled, a signature that does not certify now sends "-cl NOT_CERTIFIED", which replaces any earlier level. Signed-off-by: no84by <50858621+no84by@users.noreply.github.com>
An administrator can configure organization seal certificates (PKCS#12, each with a label) with the new libresign:organization-seal:add|list|delete commands. The PKCS#12 content and its password are kept in a sensitive app config value. The new organization_seals policy holds the list of seals applied to a request. It defaults to no seal and is stored on the request like the other request policies, so a requester picks no seal, one seal or several through policy.overrides when the administrator allows it. When the last signer signs, every chosen seal is added with the configured signing engine as an extra signature without visible field. The document is already signed, so the engine adds an approval signature and never certifies it. A document certified with no changes allowed is not sealed. A seal that cannot be applied never fails the signature; the result of every seal is stored in the file metadata under organization_seals. Signed-off-by: no84by <50858621+no84by@users.noreply.github.com>
This branch has not been deployed
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.
Resolves: #9547
Part of #7236 (company seal next to personal signatures). Roadmap: #9443 (certificates by organizational context), #8946 (PAdES).
Depends on #9552 (no certification on an already signed document).
Summary
Adds organization seals: signatures applied by the organization after the last signer has signed.
occ libresign:organization-seal:add|list|delete. The PKCS#12 content and its password are stored in a sensitive (encrypted) app config value; the list only exposes id, label, subject and expiry.organization_seals(list of seal ids, default[], request snapshot) selects the seals. A requester chooses no seal, one or several withpolicy.overrides.organization_sealswhen the administrator allows request overrides; unknown ids are rejected (422) and the value cannot change once the request is sent.organization_seals) and the file's signed hash is the sealed one.Off by default: with no seal configured or chosen, behaviour is unchanged.
Question for maintainers
The validation view marks every certificate chain of a file whose hash matches LibreSign's signed hash as trusted (
Pkcs12Handler::setIsLibreSignFile). A sealed file matches, so the seal certificate, issued by an external CA, is shown as "Certificate is trusted" whatever its real trust. This PR does not change the validation view: should seal signatures be shown with their own trust status (for example by marking only certificates issued by LibreSign's CA as LibreSign certificates)?Not in this PR (follow-ups): admin settings UI and request UI for the seals; showing seal signatures as such in the validation view; retrying a failed seal; per-group restriction of which seals a requester may use.
How to test
occ libresign:organization-seal:add "Main seal" /path/to/seal.p12(password prompted, or--password-from-envwithLIBRESIGN_SEAL_PASSWORD), thenocc libresign:organization-seal:list."policy": {"overrides": {"organization_seals": ["<id>"]}}.organization_seals.<id>.status = sealed, and with DocMDP enabled the document still has a single certification.Validation evidence
composer openapi+npm run typescript:generate, OpenAPI tests.API / Back-end changes
organization_seals(backend only for now), new occ commands, seal step inSignFileService.composer openapiwhen necessaryChecklist
AI (if applicable)