Signs a digest your page prepares for the certificate the person chooses.
One confirmation window per call: the certificate is chosen there and
prepare runs afterwards, because PAdES/CAdES put the certificate inside
the signed attributes. prepare runs again if the person switches
certificate; only the digest of the last one is signed.
The types follow your options: sign({ hash: "SHA-384", algorithm: "ECDSA", … })
gives prepare a context whose hash is "SHA-384" and algorithm is
"ECDSA", and resolves with a result typed the same way.
InvalidRequest (bad options or digest length),
Aborted (signal fired or prepare threw; the original is cause),
ExtensionMissing, AppMissing, UserCancelled, PinLocked, Timeout…
Each error's hint says what to do.
Signs a digest your page prepares for the certificate the person chooses. One confirmation window per call: the certificate is chosen there and
prepareruns afterwards, because PAdES/CAdES put the certificate inside the signed attributes.prepareruns again if the person switches certificate; only the digest of the last one is signed.The types follow your options:
sign({ hash: "SHA-384", algorithm: "ECDSA", … })givespreparea context whosehashis"SHA-384"andalgorithmis"ECDSA", and resolves with a result typed the same way.