v2.32.0-rc.4
- fix(tools): invoke tool reset methods on destroy by @prajexec in https://github.com/codex-team/editor.js/pull/3046
- fix(blocks): trigger onChange for insertMany by @ZainnQureshii in https://github.com/codex-team/editor.js/pull/3050
- Bump version up to 2.32.0-rc.4 by @github-actions[bot] in https://github.com/codex-team/editor.js/pull/3051
- @prajexec made their first contribution in https://github.com/codex-team/editor.js/pull/3046
- @ZainnQureshii made their first contribution in https://github.com/codex-team/editor.js/pull/3050
Full Changelog: https://github.com/codex-team/editor.js/compare/v2.32.0-rc.3...v2.32.0-rc.4
v6.0.2
- outliner: Pressing
Enteron the root topic no longer modifies the root topic or adds an undo step. - outliner: Splitting a topic with
Enternow correctly preserves the split prefix before the cursor instead of reverting to the old text during sync. - Plaintext export now escapes leading
>and}in node topics to prevent them from being imported as arrows or summaries, and non-arrow lines starting with>are preserved as topics.
Release v3.3.0
-
#1093 by @bobsingor –
doc.versions.analysistakesenginein place ofpolicy.engineis theanalysisvalue of the layer's head: with it, a settled answer is cached. Without it, or with another value, the answer is the server's own and is not cached. A server ignorespolicy, and no longer refuses a request for it.doc.versions.signaturestakesengineas well, thesignaturesvalue of the layer's head, with the same rule for caching. -
#1088 by @bobsingor – Two operations,
doc.signatures.validationInfoanddoc.signatures.addValidationInfo, read and store the validation data a file holds for checking its signatures with no network.doc.signatures.preparetakes a document timestamp with nofield, and its answer may carry thefieldthe engine made. All of it arrived in 3.3.
- #1088 by @bobsingor – Long-term validation works on the cloud engine.
doc.signatures.getValidationInfo()reads the validation data the layer's file holds, pinned at the document version like the signature list.doc.signatures.addValidationInfo()stores more through a route of its own, publishessignatures.validationInfoAdded, and everyone else with the layer open receives the same event. SoaddValidationInfo()from@embedpdf/core-signatureruns over the cloud engine as it does locally: the app collects the answers and the server stores them.- A document timestamp needs no
field:sign(doc, { kind: 'timestamp', key })andprepare({ kind: 'timestamp' })work, and the server makes the field. - All three need a server of version 3.3. An older one is never sent them: they fail with
NotImplemented, withdetails.needsanddetails.serverVersion. Checking signatures against an older server still works.
- #1093 by @bobsingor –
doc.signatures.analyze()no longer sends the number of its judging rules (policy), which a server on other rules refused: the verdict then read'indeterminate'. It sends the server'sanalysisengine value instead, so the answer for a saved version is still cached. It works with a server of 3.0 to 3.2 as it does with a newer one.
-
#1093 by @bobsingor –
doc.versions.analysis()takesenginein place ofpolicy.engineis theanalysisvalue of the layer's head: with it, a settled answer is cached. Without it, or with another value, the answer is the server's own and is not cached. A server ignorespolicy, and no longer refuses a request for it.doc.versions.signatures()takesengineas well, thesignaturesvalue of the layer's head, with the same rule for caching. -
#1088 by @bobsingor –
doc.signatures.validationInfo()anddoc.signatures.addValidationInfo()read and store the validation data a file holds for checking its signatures with no network: certificates, OCSP responses and CRLs, each entry as base64. A prepared signature's answer may carryfield, the field the engine made for a document timestamp prepared with none.
-
#1093 by @bobsingor – A change analysis is never refused for the rules it was asked under. The rules that judge what a signature allows after it are now a part of the
analysisengine value in/head, as the API evolution convention has every rule the server computes with.Before, a client put the number of those rules in the analysis URL (
policy), and the server answeredInvalidArgfor any number but its own. A server on new rules refused every older viewer, which then showed "what changed since the signature" as indeterminate.GET …/signatures/analysis@<token>: a token that carriespolicy, as a client of 3.0 to 3.2 writes it, is answered like any other. The token's engine value decides whether the answer is cached.GET …/versions/analysis/:sha256takesengine, theanalysisvalue from/head. With this server's value a settled answer isimmutable. With another value, or with none, the answer is this server's own, withno-storeand the current value inEmbedPDF-Engine. Apolicyparameter is ignored.- An analysis that a worker judged under other rules, in the middle of a deploy, is answered uncached. It was an error.
GET …/versions/signatures/:sha256takesenginetoo, thesignaturesvalue from/head, with the same rule:immutablewith this server's value,no-storewith another or with none. It wasimmutablewhatever the server read from the file, so a field added to that answer could not have reached a cache that held the old one.- The
analysisengine value changes once with this release, so cached analyses are computed again.
-
#1088 by @bobsingor – Validation data for signatures, and a document timestamp with no field.
GET /v1/docs/:docId/layers/:layerName/signatures/validation-infoanswers the certificates, OCSP responses and CRLs the layer's file holds, each as base64. Its@tokenform is pinned atdocVersionand cached like the signature list. It needsdoc.forms.read.POSTto the same path stores more. Each entry is checked to be one DER object of at most 16 MiB, an entry the file already holds is not stored again, and the answer counts the new ones. It needsdoc.signfor the document, and a certification that allows no changes forbids it. The document version moves, and the audit row, of the new kindsignature.addValidationInfo, carries the counts and never the entries. A client older than 3.3 gets a full refresh in its place.- The server asks no certificate authority: it stores what it is given.
POST …/signatures/preparetakes a document timestamp with nofield. The worker makes the field, the answer names it infield, and it needsdoc.signfor the document.- Changing the metadata of a layer is now refused after a certification that allows no changes, before the write reaches a worker.
- #1096 by @bobsingor –
dropsWaitingInk(before, after, message)says whether a message took the place of an ink drawing that waited in the draft for its next stroke (a pen stroke held back withdeferInkCommit). A host that runsupdateitself uses it to make the strokes an annotation withfinishInkDraftfirst, and then run the message again.
- #1091 by @bobsingor –
CommandDefinition,CommandFamily,CommandContextandIconAccentare core types now, so a plugin can ship commands without depending on the commands plugin, which still exports them.@embedpdf/core/commandshascreateDocumentCommands(): download and print, which take the browser's file download as an argument.@embedpdf/core/testinggainscreateTestCommandContext(), a command context over stand-in capabilities for testing a plugin's commands.
-
#1088 by @bobsingor – Long-term validation:
addValidationInfo()keeps a signature checkable for years, andvalidateSignatures()says whether a certificate was withdrawn and whether the file holds everything to check a signature with no network.addValidationInfo(doc, { trust, revocation }). Once a document is signed and timestamped, it asks the certificate authorities whether each certificate was still good, checks every answer, and stores them in the file with the certificates a reader needs to follow the same paths. Acrobat then calls the signature "LTV enabled", and nobody has to be asked again.- It asks about each certificate between the signer and the one you trust, and the same for the timestamp's authority: the answers the file holds first, then
known(answers and certificates you already have), thenrevocation, at the addresses the certificates name, OCSP before the issuer's list. An issuer's certificate that a signature left out is fetched from the address the certificate names, and is only ever a candidate for the path. - It returns
{ added, verdicts }: how many entries of each kind it stored, and whatvalidateSignatures()says about the result. - All or nothing: when a signature would not read as complete, nothing is stored. It throws
Network, with the address indetails.source, when an address didn't answer, and otherwiseSignatureRefusedwithdetails.reason('no-timestamp','untrusted','no-answer'or'revoked'),details.certificateanddetails.field.partial: truestores what there is instead. fieldscovers some signatures only, andmaxCrlBytes(1 MiB) is the largest list it stores.- Calling it again asks for nothing the file holds and adds nothing.
httpRevocationSource({ url })is aRevocationSourcefor a web page, which can't ask a certificate authority itself: each question goes to a route of your own. It takesurl,headers,fetch,timeoutMsandretries, ashttpTimestampAuthority()does, and tries again only when no answer came.@embedpdf/core-signature/server, a new entry, has the routes, for any server that speaks the Fetch API:revocationRoute()answershttpRevocationSource(). The addresses it is sent come from certificates, so it decides where it may go: only publichttpandhttpsaddresses, never a private or local one, a name that leads to one, or a redirect to either. It limits how large and how slow an answer may be, passes on only an OCSP response, a list of withdrawn certificates or a certificate, and keeps answers for as long as their authority's cache headers allow.timestampRoute({ url })passes a timestamp request on to the authority you name, withheadersa page must not hold.
validateSignatures(doc, { trust, revocation })asks for the answers the file lacks and uses them for that check, without storing anything. An address that doesn't answer leavesrevocationat'unknown'.longTermstays about what the file holds.sign(doc, { kind: 'timestamp', key })needs nofield. The engine makes a field for the document timestamp, so the last step of keeping a file checkable is one call.result.signature.fieldNamesays which field it is.A signature is judged at its timestamp by default.
validateSignatures()judges each certificate at the earliest trusted timestamp that covers what it signed, and as of now when there is none. It is the time a reader such as Acrobat judges at, and with the answers in the file read, a certificate is not accepted on its dates alone.validationTime: { kind: 'now' }judges every certificate as of now;{ kind: 'earliest-timestamp' }names the default. The option takes what it took before.- What changes for an app that already validates: a signature whose signer's certificate expired after it was signed, and that carries a timestamp from an authority you trust, reads
'valid'where it read'valid-untrusted'. - Judged at its timestamp, a signature reads
revocation: 'good'from the answers stored when it was signed, and a certificate withdrawn after the timestamp does not make it'invalid'. Judged as of now, the same answers read'unknown', and the withdrawal reads'invalid'. - A signature with no timestamp you trust is judged as of now, as before.
validationTimenames a timestamp's timestampedAt.{ kind: 'timestamp', stampedAt, tokenVerified: true }: the name the timestamp's own verdict uses, so the time a verdict reports reads the same wherever it appears.genTime, its name until now, still works until 4.0. A verdict'svalidationTimecarries the time under both names, with the same value (AppliedValidationTime), and the option takes either. Given both,stampedAtis the one used.- On a value you type as
ValidationTimeyourself,genTimeis optional now. A verdict'svalidationTimealways has it.
revocationon every verdict.'good','revoked'or'unknown': whether a certificate between the signer and your anchor was withdrawn byvalidationTime.revocationReasonnames the certificate when it isn't'good'. A timestamp's verdict has both too, for its authority.- The answers come from the file and nothing is asked over a network: the document's validation data (
doc.signatures.getValidationInfo()), the OCSP responses and CRLs a signature carries in its CMS, and Acrobat'sadbe-revocationInfoArchivalattribute. Each answer is checked by its own signature, wherever it sits. - An answer speaks for a time. One stored at signing says the certificate was good then, so a signature judged at its timestamp reads
'good', and judged as of now it reads'unknown'. A certificate withdrawn after the timestamp reads'good'at the timestamp and'revoked'as of now. summaryis'invalid'when a trusted signer's certificate is proven withdrawn by the time it is judged at. It was'valid'before, because nothing was checked.'unknown'never changessummary. A timestamp whose trusted authority is proven withdrawn is'invalid'and no longer counts as a trusted time.- A certificate you trust as it is has nobody above it to withdraw it, so it reads
'good'.
longTermon every verdict.{ enabled, provenAt, expiresAt, documentTimestampedAt, missing }, always judged at the time a timestamp proves, whatevervalidationTimeis.enabledis what Acrobat calls "LTV enabled": a timestamp you trust covers the signature, the signer was trusted then, and the file holds a good answer for every certificate of the signer's path and of the timestamp authority's.provenAtis that time,expiresAtthe day the certificate of the last covering timestamp expires, anddocumentTimestampedAtthe time of the last trusted document timestamp added after the signature. Each is a point in time, named as the API names them everywhere: an ISO 8601 string ending inAt.missingsays what stands in the way, one{ certificate, reason }per certificate:'no-timestamp','untrusted','no-answer'or'revoked'.- It agrees with Acrobat's "LTV enabled" line on each of the 32 signatures Acrobat judged in the repository's fixtures.
A path may pass through the certificates the file holds. A signature that leaves an issuer's certificate out of its CMS is
'trusted'when the document's validation data has it.validateChain()'s verdict haswithoutIssuer: the certificate whose issuer wasn't found, when that is why a path isn't trusted.New exported types:
AppliedValidationTime,LongTermVerdict,LongTermGap,LongTermGapReason,RevocationVerdict,AddValidationInfoOptions,AddValidationInfoResult,HttpRevocationSourceOptions,RevocationRouteRequest.A test certificate authority.
createTestCertificateAuthority()is a throwaway authority for tests and demos.authority.issueSigner()gives a signer whose certificate chains toauthority.certificateand names where to ask about it.authority.revocationanswers those questions from memory, as a real authority answers them over HTTP: an OCSP response signed by a responder the authority certified, and a CRL.authority.revoke(signer, { at, reason })withdraws a certificate, and both answers say so from then on. OpenSSL verifies its answers.Asking an authority.
RevocationSourceis where revocation answers come from: one method,fetch(request), that returns the bytes answering aRevocationRequest(an OCSP request for a responder, or an address to fetch a CRL or an issuer's certificate from).RevocationReasonnames why a certificate was withdrawn.A document timestamp only from an authority you trust.
sign(doc, { kind: 'timestamp', key, timestampTrust })refuses a token from an authoritytimestampTrustdoesn't cover, as it does for a signature's own timestamp, and leaves nothing signed. Before,timestampTrustwith a document timestamp failed withInvalidArg.Certificates that can't be withdrawn. A signing service that issues a certificate for one signature, valid for minutes, runs no revocation service for it, and the certificate says so in an extension: "validity assured, short term" (ETSI EN 319 412-1) or
noRevAvail(RFC 9608). Such a certificate needs no answer:revocationreads'good'when the certificates above it do,longTermcounts nothing as missing for it, andaddValidationInfo()asks nobody about it. The extension counts on a certificate that issues nothing, andnoRevAvaildoesn't count beside an address to ask at.createTestCertificateAuthority()'sissueSigner({ unrevocable })issues one, with'validity-assured'or'no-rev-avail'(Unrevocable). - It asks about each certificate between the signer and the one you trust, and the same for the timestamp's authority: the answers the file holds first, then
-
#1092 by @bobsingor –
pkijs4 andasn1js4. Both are ES modules only and no longer usepvtsutils, the one CommonJS module this package brought along. An Angular production build no longer warns thatpvtsutilsis not ESM, and anallowedCommonJsDependenciesentry for it can go.CommonJS works as before.
require()does not load an ES module on every Node, or in Jest, so the CommonJS files of this package hold the two libraries and the three they use.require('@embedpdf/core-signature')loads no ES module, and neither does a package that loads it. Jest in its CommonJS mode needs no configuration.- The type declarations for CommonJS hold the libraries' types, so TypeScript that compiles to CommonJS reads them with any
modulesetting. dist/THIRD-PARTY-NOTICES.txtlists what the files hold, with each version and license, andinlinedDependenciesinpackage.jsonhas the versions.- The CommonJS files are about 930 kB, where they were 180 kB. The ES module files import the libraries as before.
In Node, the two libraries ask for Node 22.12 or newer, or 20.19 or newer on Node 20. npm warns when it installs them on an older one.
A time from 2050 on is written as GeneralizedTime. A signing time (
subFilter: 'adbe.pkcs7.detached'), and the dates of the certificates and revocation lists this package makes, were always written as UTCTime, which ends with the year 2049: a signing time in 2050 was written as 1950. RFC 5652 and RFC 5280 have a later time as GeneralizedTime. Times are written to the second. -
#1087 by @bobsingor – Signature timestamps (PAdES B-T): a signature can carry an RFC 3161 token from a timestamp authority, and a reader says what that token is worth.
Signing.
sign()takestimestampAuthority: the signature then carries a timestamp from that authority, stored inside the signature. A timestamp that can't be had fails the signing, so nothing is signed without it.timestampTrustrefuses a token from an authority that trust port doesn't cover. With atimestampAuthority,sign()reserves 16384 bytes for the signature unlesscontentsSizeBytessays otherwise.httpTimestampAuthority({ url })is an authority reached over HTTP, for a signature's timestamp and for a document timestamp. It tries again only when no answer came, and every error it raises carries the authority's address indetails.authority.Two steps.
completeSignature(doc, { prepared, cms })is the second half ofsign(): it checks the CMS against what was prepared, adds the timestamp when asked, and completes. A failure leaves the signing prepared.attachSignatureTimestamp({ cms, authority })adds a timestamp to a finished CMS and leaves every other byte of it as it was, also for a CMS written with indefinite lengths.Reading.
validateSignatures()reports each signature's timestamp inverdict.timestamp: whether the token checks out and stamps this signature, whether its authority is trusted and made for timestamping, the time it vouches for, and the authority's name. It never changes the signature'ssummary. A document timestamp reads back with a real verdict, where it readindeterminate.validationTime: { kind: 'earliest-timestamp' }judges each certificate at the earliest trusted timestamp that covers what it signed, and now when there is none.verifyTimestampToken()checks a token over any digest.Trust.
TrustPorttakes an optionaltimestampAnchors(): the certificates trusted for timestamp authorities, apart fromanchors(), the ones trusted for signers. Signer trust is judged on the certificate that signed:validateChain(), andvalidateSignatures()through it, validated whichever certificate the CMS carried last, so a signature whose own certificate led nowhere could readtrustedwhen another certificate in the same CMS reached an anchor, and an expired signer could pass on the dates of its issuers. A missing issuer is named in the reason.Checks that changed. Certificate bindings are read in every form: the SHA-1
signing-certificateattribute, andsigning-certificate-v2with SHA-384 or SHA-512 beside SHA-256. A document timestamp whose token uses one of them completes where it was refused; a signature whose binding names another certificate isinvalidwhere a SHA-1 binding was ignored; a binding with an unknown hash readsunsupported. A document timestamp token that binds no certificate at all is refused at completion. The completion gate checks a timestamp a CMS already carries: one that provably stamps something other than the signature is refused. When a signature doesn't fit the room reserved for it, the refusal names thecontentsSizeBytesto prepare with.Also. A CMS key may declare a
hash, whichsign()takes as its default digest.ecdsaRawFromDer()turns the DER ECDSA signature most signing services return into ther || sa raw key returns.createTestTimestampAuthority()signs with a certificate made for a timestamp authority, so validators such as OpenSSL accept its tokens.
-
#1094 by @bobsingor – The serial number of a certificate or a timestamp token this package makes is always DER. It was eight random bytes with only the top bit cleared, so about one in 256 began with a zero byte that DER leaves out, and a strict reader refused it: OpenSSL can't decode such a certificate.
personalSigner(),createTestSigner()andcreateTestTimestampAuthority()made them that way.A certificate that a personal key store already holds keeps the serial number it has.
store.remove(subject)has the nextpersonalSigner()make a new one. -
#1090 by @bobsingor – A PKCS#7 signature's signed attributes are in DER order.
sign(doc, { subFilter: 'adbe.pkcs7.detached' })wrote its signed attributes, and signed them, in the order content type, message digest, signing time. DER puts the signing time before the message digest, and RFC 5652 has the signature made over the attributes in DER. They are now sorted before they are signed, so a reader that encodes them again before it checks the signature gets the bytes that were signed.- The default,
'ETSI.CAdES.detached', was in DER order already, and so was the test timestamp authority's token. - A signature made before still verifies here: it is checked over the order it was written in.
- The default,
-
#1093 by @bobsingor – An analysis URL names the server's
analysisengine value, and no policy number.encodeAnalysisToken()no longer writespolicy, anddecodeAnalysisToken()reads past one.AnalysisToken.policyVersionis deprecated and ignored; it goes in 4.0.analysisQueryString()no longer writespolicy. It takesengine, the server'sanalysisvalue, and writes it as a query parameter.VersionAnalysisQuerySchemahasenginein place ofpolicy.wirePaths.layerVersionSignatures()takesengine, the server'ssignaturesvalue, and writes it as a query parameter.VersionSignaturesQuerySchemais its query.
SIGNATURE_POLICY_VERSIONandpolicyVersionon an analysis are as they were. -
#1088 by @bobsingor – Read and store the validation data of a document, timestamp a document with no field made first, and judge two cases the way Acrobat does.
doc.signatures.getValidationInfo()anddoc.signatures.addValidationInfo(). A PDF keeps what a reader needs to check its signatures later with no network in its document security store (/DSS): certificates, OCSP responses and CRLs.getValidationInfo()returns them as{ certificates, ocspResponses, crls }, each entry as DER bytes, once. It reads the document as it is now, so an entry that was added and not yet saved is among them. It needsdoc.forms.read.addValidationInfo(input)stores entries and returns{ added, meta }, whereaddedcounts the new ones of each kind. An entry the document already holds, byte for byte, is not stored again.- Each entry must be one DER object of at most 16 MiB (
VALIDATION_INFO_LIMITS.entryBytes). Otherwise the call fails withInvalidArg,details.fieldnames the entry, and nothing is stored. What an entry says is not checked. - It is a change of the document: it is in the file at the next save, as a revision after the signatures, and a signature made after it seals it in. It has no undo (
meta.undoableisfalse), and undoing another change leaves it in place. - It needs
doc.sign. After a certification that allows no changes it fails withProtectedDocument. - It fires
signatures.validationInfoAdded, withadded, when it stored something.
- Each entry must be one DER object of at most 16 MiB (
- New exports: the types
ValidationInfo,ValidationInfoAddResult,ValidationInfoCountsandValidationInfoKind,VALIDATION_INFO_KINDS,VALIDATION_INFO_LIMITS, andvalidationInfoEntryProblem(), which says why bytes are not an entry the engine stores.
A document timestamp needs no field.
doc.signatures.prepare({ kind: 'timestamp' })may leavefieldout: the engine then makes a signature field for it, with a name no other field has (Timestamp1,Timestamp2, and so on) and one widget of no size on the first page, in the same revision as the timestamp.SignaturePrepareInput.fieldis optional for that reason, andSignaturePrepared.fieldnames the field the engine made. A signature with nofieldfails withInvalidArg. It needsdoc.sign, not the right to sign a group's fields.A certification that allows no changes (
permission: 1) allows no later revision. The PDF standard lets validation data and a document timestamp follow one, and the engine did too. Acrobat reports such a certification as invalid once anything is added, so:analyze()andvalidateSignatures()read every object written after it asforbidden, with the ruleno-changes-certification. Validation data and a document information dictionary readpermittedbefore.- The engine refuses signing, a document timestamp included, and metadata changes on such a document, with
ProtectedDocument.doc.security.allows('doc.sign')isfalsethere.signedDocumentPolicy: 'permit'still turns the refusals off. - A document timestamp that was added after such a certification is judged on its own, as Acrobat judges it: the certification reads changed, the timestamp does not inherit its limit.
What Acrobat adds to a page no longer reads as a forbidden change because of where the page keeps its annotation list. Acrobat keeps a page's
/Annotsas an object of its own. A document timestamp, a signature in a new field or a comment added after a signature readforbiddenfor the earlier signature in three cases, and now readpermitted, as they do when the list is an array inside the page:- the list moves out of the page into an object of its own, with the new signature field's widget (what Acrobat does the first time);
- the list already is an object of its own and grows there;
- the page is pointed at a new list object and the old one stays in the file, unwritten (what Acrobat does for a second timestamp). No later revision holds the old list, so the engine reads it from the earlier revision.
For that third case an engine hands the rules the objects they ask for:
unwrittenObjectsToRead()names them, andStepInput.unwrittencarries them (UnwrittenObject). Without them such a page readsforbidden, with a reason that says the earlier list could not be read.SIGNATURE_POLICY_VERSIONis 5. For a certification at level 2 or 3 and for approval signatures nothing changes.On the wire, for the cloud (3.3).
@embedpdf/engine-core/wirehas the schemas for validation data as base64 (ValidationInfoWireSchema,ValidationInfoAddBodySchema,ValidationInfoAddResultSchema, withencodeValidationInfo()anddecodeValidationInfo()), a cached read kindvalidationInfowith its paths and resource, andVALIDATION_INFO_SINCE, the version these arrived in. A prepare's body may leavefieldout, and its answer may carry thefieldthe engine made. The worker's answer to a prepare says the object number of the field the signing goes in.
- #1080 by @bobsingor – An app that imports
@embedpdf/enginebuilds with Parcel again. The check behind the development warnings readprocess?.env?.NODE_ENV, which Parcel does not replace: it took it for a use of Node'sprocessand stopped the build withNode builtin polyfill "process/" is not installed. The check now readsprocess.env.NODE_ENVas written, the expression every bundler replaces.
-
#1088 by @bobsingor – Add
doc.signatures.getValidationInfo()anddoc.signatures.addValidationInfo().A PDF keeps what a reader needs to check its signatures later with no network in its document security store: certificates, OCSP responses and CRLs. Acrobat calls a signature whose data is there "LTV enabled".
const stored = await doc.signatures.getValidationInfo(); stored.certificates; // DER bytes, one per certificate const result = await doc.signatures.addValidationInfo({ ocspResponses: [answer], }); result.added; // { certificates: 0, ocspResponses: 1, crls: 0 }
addValidationInfo()stores nothing the document already holds, and nothing at all when an entry is not one DER object (InvalidArg).- What it stores is in the file at the next save, as a revision after the signatures, so they still verify. A signature made after it seals it in. It has no undo.
- It needs
doc.sign, and fails withProtectedDocumentafter a certification that allows no changes. - It fires
signatures.validationInfoAddedwhen it stored something.
A document timestamp needs no field:
doc.signatures.prepare({ kind: 'timestamp' })with nofieldmakes one for it, with no size, so it shows nowhere on the page. The field is added in the same revision as the timestamp, andprepared.fieldnames it.A signature field or document timestamp that Acrobat adds to a page whose annotation list is an object of its own now reads
permittedfor the earlier signatures, as Acrobat reads it.
- #1079 by @bobsingor –
localEngine()starts under a dev server that prebundles packages without their files: Vite 7 and older, which includesng servein Angular 20 and 21. The engine's worker URL pointed into the dev server's cache folder, where nothing is, so the document never opened. There the engine now starts fromblob:workers and a copy of the WebAssembly that only a dev build carries (@embedpdf/engine/dev-wasm). A production build is unchanged. An engine that cannot start now also says so in the console, with the URL it tried.
-
#1088 by @bobsingor – Read and store a document's validation data, and read a page's earlier annotation list from the file.
ValidationInfoReaderreads the certificates, OCSP responses and CRLs of the document security store (/DSS), andValidationInfoMutatorstores new ones. The mutator checks every entry before it writes the first, and leaves out an entry the document already holds.- The worker host answers two new requests,
signatures.validationInfoandsignatures.addValidationInfo. The second is a write: it runs in one transaction and has no undo. SignatureAnalyzerreads the objects the rules ask for that a revision did not write, and hands them to the rules. A signature field or timestamp that Acrobat adds to a page whose annotation list is an object of its own now readspermittedfor the earlier signature.SignatureMutator.prepare()takes a document timestamp with nofield: it makes the field on the signing candidate, so the live document gets it when the signing completes, in the timestamp's own revision, and never when it is cancelled.
This needs a runtime that has
EPDFDss_GetCount,EPDFDss_GetData,EPDFDss_AddandEPDFDoc_GetLoadedObjectValue.
-
#1091 by @bobsingor – Each feature entry exports its plugin's commands as a list:
stageCommandsfrom/stage,interactionCommandsfrom/interaction,selectionCommandsfrom/selection,annotationCommandsfrom/annotation,historyCommandsfrom/history,renderCommandsfrom/renderanddocumentCommandsfrom/runtime.standardCommandsis these lists joined. To leave some commands out, spread the lists you want in place ofstandardCommands./interactionalso exportstoolCommand(id), the command behindtool:<id>, to give a tool of your own a shortcut.standardCommandsgainshistory:undo(Mod+Z) andhistory:redo(Mod+Shift+Z,Mod+Y), from the history plugin's list. They run the history plugin's undo and redo, and stay disabled withoutwithHistory()or while there is nothing to undo or redo. A command of your own with one of these ids still replaces the standard one when it comes after...standardCommandsin thecommandssetting ofwithCommands(). With the standard commands in use,registerCommand()with one of these ids now needs{ replace: true }. -
#1088 by @bobsingor –
EpdfSignaturehasaddValidationInfo()andcanAddValidationInfo(), as the signature plugin does.
- #1092 by @bobsingor – A production build no longer warns that
pvtsutilsis not ESM. The signature package moved topkijs4 andasn1js4, which no longer use it. AnallowedCommonJsDependenciesentry forpvtsutilscan go.
-
#1091 by @bobsingor – Each feature entry exports its plugin's commands as a list:
stageCommandsfrom/stage,interactionCommandsfrom/interaction,selectionCommandsfrom/selection,annotationCommandsfrom/annotation,historyCommandsfrom/history,renderCommandsfrom/renderanddocumentCommandsfrom/runtime.standardCommandsis these lists joined. To leave some commands out, spread the lists you want in place ofstandardCommands./interactionalso exportstoolCommand(id), the command behindtool:<id>, to give a tool of your own a shortcut.standardCommandsgainshistory:undo(Mod+Z) andhistory:redo(Mod+Shift+Z,Mod+Y), from the history plugin's list. They run the history plugin's undo and redo, and stay disabled withouthistoryPlugin()or while there is nothing to undo or redo. A command of your own with one of these ids still replaces the standard one when it comes after...standardCommandsin thecommandssetting ofcommandsPlugin(). With the standard commands in use,registerCommand()with one of these ids now needs{ replace: true }.
-
#1091 by @bobsingor – Each feature entry exports its plugin's commands as a list:
stageCommandsfrom/stage,interactionCommandsfrom/interaction,selectionCommandsfrom/selection,annotationCommandsfrom/annotation,historyCommandsfrom/history,renderCommandsfrom/renderanddocumentCommandsfrom/runtime.standardCommandsis these lists joined. To leave some commands out, spread the lists you want in place ofstandardCommands./interactionalso exportstoolCommand(id), the command behindtool:<id>, to give a tool of your own a shortcut.standardCommandsgainshistory:undo(Mod+Z) andhistory:redo(Mod+Shift+Z,Mod+Y), from the history plugin's list. They run the history plugin's undo and redo, and stay disabled withouthistoryPlugin()or while there is nothing to undo or redo. A command of your own with one of these ids still replaces the standard one when it comes after...standardCommandsin thecommandssetting ofcommandsPlugin(). With the standard commands in use,registerCommand()with one of these ids now needs{ replace: true }.
-
#1091 by @bobsingor – Each feature entry exports its plugin's commands as a list:
stageCommandsfrom/stage,interactionCommandsfrom/interaction,selectionCommandsfrom/selection,annotationCommandsfrom/annotation,historyCommandsfrom/history,renderCommandsfrom/renderanddocumentCommandsfrom/runtime.standardCommandsis these lists joined. To leave some commands out, spread the lists you want in place ofstandardCommands./interactionalso exportstoolCommand(id), the command behindtool:<id>, to give a tool of your own a shortcut.standardCommandsgainshistory:undo(Mod+Z) andhistory:redo(Mod+Shift+Z,Mod+Y), from the history plugin's list. They run the history plugin's undo and redo, and stay disabled withouthistoryPlugin()or while there is nothing to undo or redo. A command of your own with one of these ids still replaces the standard one when it comes after...standardCommandsin thecommandssetting ofcommandsPlugin(). With the standard commands in use,registerCommand()with one of these ids now needs{ replace: true }.
-
#1091 by @bobsingor – The annotation plugin ships its own command:
createAnnotationCommands()makes the list withannotation:delete. It comes from a new@embedpdf/plugin-annotation/commandsentry. It is the command@embedpdf/plugin-commands/standardheld, unchanged. The entry reads the plugin through its contract, so the list brings no plugin code with it. Each framework package has the list ready asannotationCommands.The tools the plugin registers say whether the user may use them (
canUse()on the interaction plugin'sTool): only a user who may create annotations. Sotool:<id>shows disabled without that permission, as before, and the tool commands no longer ask the annotation plugin. -
#1096 by @bobsingor – A pen or highlighter drawing is no longer lost when something else happens right after a stroke. After a stroke the pen waits a moment for the next stroke of the same drawing. Pressing another annotation in that moment dropped the stroke, and so did starting a marquee selection, opening a text box for typing, deleting the selection, and creating a markup from code. Now the stroke becomes an annotation first, and a press selects only what it hit. Fixes #1062.
Picking another tool during that wait keeps the tool you picked: with
afterCreate.tool: 'default'the viewer went back to the default tool instead.finishInkDraft()on the host capability now leaves a stroke that is still being drawn alone.A polygon, a polyline or a callout that is being drawn keeps its next click when that click lands on another annotation: the click places the point, where it selected that annotation and dropped the shape. The distance tool already worked this way. While such a shape is being drawn, the pointer keeps the tool's cursor over an annotation.
hasCreationAwaitingClick()on the host capability says whether a shape waits for such a click.
- #1091 by @bobsingor –
createStandardCommands()in@embedpdf/plugin-commands/standardis deprecated. It keeps returning the commands it had in 3.2, now joined from the lists their plugins ship (createStageCommands()in@embedpdf/plugin-stage/commands, and so on), and nothing new joins it. Spread your framework package'sstandardCommands, or the lists you need. The command types (CommandDefinition,CommandFamily,CommandContext,IconAccent) are re-exported from@embedpdf/core, where they live now.
- #1091 by @bobsingor – The history plugin ships undo and redo as commands:
createHistoryCommands()makes the list ofhistory:undo(Mod+Z) andhistory:redo(Mod+Shift+Z,Mod+Y). It comes from a new@embedpdf/plugin-history/commandsentry. They stay disabled while there is nothing to undo or redo. The entry reads the plugin through its contract, so the list brings no plugin code with it. Each framework package has the list ready ashistoryCommands, and it is part ofstandardCommands.
- #1089 by @bobsingor – EmbedPDF's own strings gain
commands.history.undoandcommands.history.redo, the labels of the standard undo and redo commands, in all eight languages.
-
#1091 by @bobsingor – The interaction plugin ships the tool commands:
createInteractionCommands()makes the list oftool:pointer,tool:pan,tool:zoomandtool:<id>for every other tool, andtoolCommand(id)is the command behindtool:<id>, to build a tool's own command on. They come from a new@embedpdf/plugin-interaction/commandsentry. They are the commands@embedpdf/plugin-commands/standardheld, unchanged. The entry reads the plugin through its contract, so the list brings no plugin code with it. Each framework package has the list ready asinteractionCommands.A tool can say whether the user may use it:
Toolgains an optionalcanUse(), and the plugincanUseTool(id), which istruefor a tool without one andfalsefor an id that isn't registered. The tool commands show disabled while it says no. Switching to a tool doesn't ask.
- #1091 by @bobsingor – The render plugin ships the snapshot's commands:
createRenderCommands()makes the list oftool:snapshot,snapshot:copy,snapshot:saveandsnapshot:clear, and takes the browser's clipboard write and file download as an argument. It comes from a new@embedpdf/plugin-render/commandsentry. They are the commands@embedpdf/plugin-commands/standardheld, unchanged. The entry reads the plugin through its contract, so the list brings no plugin code with it. Each framework package has the list ready asrenderCommands.
- #1091 by @bobsingor – The selection plugin ships its own command:
createSelectionCommands()makes the list withselection:copy, and takes the browser's clipboard write as an argument. It comes from a new@embedpdf/plugin-selection/commandsentry. It is the command@embedpdf/plugin-commands/standardheld, unchanged. The entry reads the plugin through its contract, so the list brings no plugin code with it. Each framework package has the list ready asselectionCommands.
-
#1088 by @bobsingor – Verdicts say whether a certificate was withdrawn and whether the file is "LTV enabled", and a signature is judged at its timestamp by default.
- Every verdict from
validate()andvalidateField()carriesrevocation('good','revoked'or'unknown', withrevocationReason) andlongTerm({ enabled, provenAt, expiresAt, documentTimestampedAt, missing }), read from the answers the file holds. A signer you trust whose certificate is proven withdrawn reads'invalid'. validate()andvalidateField()judge each certificate at the earliest trusted timestamp that covers what it signed, and as of now when there is none. A signature whose signer's certificate expired after it was signed, and that carries a timestamp from an authority you trust, reads'valid'where it read'valid-untrusted'. PassvalidationTime: { kind: 'now' }to judge every certificate as of now.- A verdict's
validationTimenames a timestamp's timestampedAt.genTime, its name until now, is there beside it and is still taken byvalidate(), until 4.0.AppliedValidationTime, the type of what a verdict reports, comes with the plugin's exports.
Signatures that stay checkable. Two settings and two methods keep what the plugin seals checkable with no network.
revocationis where revocation answers come from, such ashttpRevocationSource({ url }). With it, every signature the plugin seals gets its validation data right after: the answers that say its certificates were good at its timestamp, stored in the file. It needstrust.documentTimestamp: truethen adds a document timestamp fromtimestampAuthority.- The signature is sealed first, so a failure afterwards can't undo it.
sign(),completeSignature()andplaceMark()still resolve, and the result says what happened:validationInfois{ added, documentTimestamp }, ornullwhen nothing was to be added, andvalidationInfoErroris the error that kept the data or the document timestamp out, ornull. - Only the signature just made is covered. A session without
doc.sign, such as a signer of one group's fields, signs without the follow-up. addValidationInfo(field?)does the same for a signed field, or for every signature, and rejects when one can't be covered.canAddValidationInfo()says whether it can: therevocationandtrustsettings, anddoc.sign.- The verdicts are read again when anyone adds validation data to the document. Checking asks nobody: only what the file holds counts.
httpRevocationSourceandcreateTestCertificateAuthoritycome with the plugin's exports, beside the signers.
- Every verdict from
-
#1087 by @bobsingor – The
timestampAuthoritysetting: every signature the plugin seals then carries a timestamp from that authority, in one step and in two, and a timestamp that can't be had fails the signing.sign()andprepareSignature()take a per-calltimestampAuthority;nullseals that one without a timestamp. With thetrustsetting set, a timestamp from an authority it doesn't cover is not sealed.completeSignature()checks the CMS against what was prepared before it seals anything, where it handed it to the engine as it was: a CMS that doesn't sign the prepared digest is refused instead of written. When it fails, the signing stays prepared, to complete again or to cancel.validate()takesvalidationTime: { kind: 'earliest-timestamp' }, and a verdict carries its signature's timestamp intimestamp.httpTimestampAuthorityandcreateTestTimestampAuthoritycome with the plugin's exports, beside the signers.
- #1090 by @bobsingor – A PKCS#7 signature's signed attributes are in DER order. With
subFilter: 'adbe.pkcs7.detached'the signing time was written after the message digest, where DER puts it before. A reader that encodes the attributes again before it checks the signature now gets the bytes that were signed. Signatures made before still verify.
- #1091 by @bobsingor – The Stage ships its own commands:
createStageCommands()makes the list of zoom, the page moves and view rotation. It comes from a new@embedpdf/plugin-stage/commandsentry. They are the commands@embedpdf/plugin-commands/standardheld, unchanged. The entry reads the plugin through its contract, so the list brings no plugin code with it. Each framework package has the list ready asstageCommands.
- #1039 by @bobsingor –
importLibrary(bytes, { id })imports a library under the id you give it, over the one the file names, so its stamps have ids you know ahead (<id>:<name>). A taken id still gets a fresh one.
-
#1039 by @bobsingor –
plugins.stamp.librariesgives the viewer your own stamp libraries, each{ id, url }or{ id, data }: loaded when the viewer starts, never stored in the browser, listed in the stamps panel without a way to remove them, and named inquickas<id>:<name>. Quick stamps in the Insert toolbar now show at the button's full height, so a wide stamp no longer shrinks to a few pixels. A stamp library of your own as the standard stamps (plugins.stamp.standard: '/my-stamps.pdf') is no longer stored in the browser: it went in under the id its file names, or a fresh one for a file that names none (an Acrobat stamp file), so it was stored and imported again beside the stored copy on every visit. It now goes in under the standard id, like the copy that ships, sostandard:<name>inquickfinds its stamps. Copies already stored stay in the stamps panel, where each can be removed. Fixes #1084. -
#1088 by @bobsingor – The signature inspector says how a signature will hold up. A Revocation line shows when the file holds an answer about the signer's certificate: not revoked, or revoked. A Long-term validation line says whether the file holds everything a reader needs to check the signature with no network: enabled, with the day that proof runs out, or not enabled, with what is missing. For a signature that isn't enabled, Add verification information asks for the answers and stores them, when the
revocationandtrustsettings are set and the person may sign.When a signature is sealed and its verification information can't be added, the sign dialog and the signatures panel say so: the document is signed, and the inspector offers to add it later.
The details of a signature whose box has no size, such as a document timestamp's, open at the corner of the viewer and no longer at a point on the page.
Seventeen new strings, in all fifteen languages.
httpRevocationSourceandcreateTestCertificateAuthorityare exported beside the signers. -
#1087 by @bobsingor – The signature inspector shows a signature's timestamp: the time its timestamp authority vouches for and the authority's name, in the tone of the timestamp's verdict. When a signing fails at its timestamp, the sign dialog says so in the viewer's language: the timestamp service did not answer, or it refused. Three new strings, in all fifteen languages.
httpTimestampAuthorityandcreateTestTimestampAuthorityare exported beside the signers.
-
#1039 by @bobsingor –
plugins.stamp.librariesgives the viewer your own stamp libraries, each{ id, url }or{ id, data }, such as a check mark and a cross for ticking off a printed form: loaded when the viewer starts, never stored in the browser, and named inquickas<id>:<name>to show in the Insert toolbar. Quick stamps now show at the button's full height, so a wide stamp no longer shrinks to a few pixels. TheStampLibraryFiletype describes one library. A stamp library of your own as the standard stamps (plugins.stamp.standard: '/my-stamps.pdf') no longer shows up once more in the stamps panel on every visit: it is never stored in the browser now, like the copy that ships, andstandard:<name>inquickfinds its stamps. Copies already stored stay in the panel, where each can be removed. Fixes #1084. -
#1088 by @bobsingor –
plugins.signature.revocationkeeps every signature the viewer seals checkable with no network: its validation data is stored in the file right after the seal.plugins.signature.documentTimestampadds a document timestamp after it.httpRevocationSourceandcreateTestCertificateAuthorityare exported beside the signers. -
#1087 by @bobsingor –
plugins.signature.timestampAuthoritygives every signature the viewer seals a timestamp.httpTimestampAuthorityandcreateTestTimestampAuthorityare exported beside the signers, so the authority comes from the same import as the key.
- #1092 by @bobsingor – An Angular production build of an app with the viewer no longer warns that
pvtsutilsis not ESM. The signature package moved topkijs4 andasn1js4, which no longer use it. AnallowedCommonJsDependenciesentry forpvtsutilscan go.
- #1088 by @bobsingor – A widget whose box has no size shows nowhere, and is now treated that way. This is how a PDF keeps an invisible signature and the field of a document timestamp. Tab no longer stops at it,
focus()answersfalsefor its field, it gets no fill control, and in design mode it is not lent to the annotation tools, so a click or a marquee can no longer select it.