| Modifier and Type | Field and Description |
|---|---|
| private Certificate[] | |
| private boolean | |
| private PrivateKey | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | CreateSignatureBase(KeyStore
is a pkcs12 keystore. keystore, char[] is the pin for the keystore / private key pin)Initialize the signature creator with a keystore (pkcs12) and pin that should be used for the signature. |
| Modifier and Type | Method and Description |
|---|---|
| public Certificate[] | |
| public boolean | |
| public final void | |
| public void | setExternalSigning(boolean
true if external signing should be performedSet if external signing scenario should be used. |
| public final void | |
| public void | |
| public byte[] | sign(InputStream
is the content as a (Filter)InputStream content)Implements org. SignatureInterface sample implementation. |
| certificateChain | back to summary |
|---|---|
| private Certificate[] certificateChain | |
| externalSigning | back to summary |
|---|---|
| private boolean externalSigning | |
| privateKey | back to summary |
|---|---|
| private PrivateKey privateKey | |
| tsaUrl | back to summary |
|---|---|
| private String tsaUrl | |
| CreateSignatureBase | back to summary |
|---|---|
| public CreateSignatureBase(KeyStore keystore, char[] pin) throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, CertificateException Initialize the signature creator with a keystore (pkcs12) and pin that should be used for the signature.
| |
| getCertificateChain | back to summary |
|---|---|
| public Certificate[] getCertificateChain() | |
| isExternalSigning | back to summary |
|---|---|
| public boolean isExternalSigning() | |
| setCertificateChain | back to summary |
|---|---|
| public final void setCertificateChain(final Certificate[] certificateChain) | |
| setExternalSigning | back to summary |
|---|---|
| public void setExternalSigning(boolean externalSigning) Set if external signing scenario should be used.
If
Default:
| |
| setPrivateKey | back to summary |
|---|---|
| public final void setPrivateKey(PrivateKey privateKey) | |
| setTsaUrl | back to summary |
|---|---|
| public void setTsaUrl(String tsaUrl) | |
| sign | back to summary |
|---|---|
| public byte[] sign(InputStream content) throws IOException Implements org. SignatureInterface sample implementation. This method will be called from inside of the pdfbox and create the PKCS #7 signature. The given InputStream contains the bytes that are given by the byte range. This method is for internal use only. Use your favorite cryptographic library to implement PKCS #7 signature creation. If you want to create the hash and the signature separately (e.g. to transfer only the hash to an external application), read this answer or this answer.
| |