Interface PdfSignatureProvider
public interface PdfSignatureProvider
Supplies the key material of a PDF signature without exposing the key.
PdfDocument computes what has to be signed and calls [#sign(byte[])]
exactly once while saving. On a device, PdfSigner.provider answers
with the platform crypto bridge. On a Codename One server, implement it
over com.codename1.backend.Crypto.sign (RS256 or ES256 with the
PKCS#8 key), which runs on the JVM and compiled alike; a hardware
security module fits the same shape, so the private key never leaves
it.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[][]The DER X.509 certificates: the signer's first, then any intermediates a verifier needs to build the chain.The key algorithm,RSAorEC.byte[]sign(byte[] data) Signsdatawith SHA-256 and the private key.
-
Method Details
-
getKeyAlgorithm
String getKeyAlgorithm()The key algorithm,RSAorEC. The signature is SHA-256 with that key (SHA256withRSAorSHA256withECDSA). -
getCertificateChain
byte[][] getCertificateChain()The DER X.509 certificates: the signer's first, then any intermediates a verifier needs to build the chain. -
sign
Signsdatawith SHA-256 and the private key. ECDSA signatures are returned DER encoded (ECDSA-Sig-Value), as every Codename One port and the backend'sCrypto.signproduce them.- Throws:
IOException- when the key cannot sign: a hardware key that is locked, a remote signing service that cannot be reached. The save that asked fails with it.
-