Package com.itextpdf.text.pdf.security
Interface ExternalSignature
- All Known Implementing Classes:
PrivateKeySignature
public interface ExternalSignature
Interface that needs to be implemented to do the actual signing.
For instance: you'll have to implement this interface if you want
to sign a PDF using a smart card.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the encryption algorithm used for signing.Returns the hash algorithm.byte[]
sign
(byte[] message) Signs it using the encryption algorithm in combination with the digest algorithm.
-
Method Details
-
getHashAlgorithm
String getHashAlgorithm()Returns the hash algorithm.- Returns:
- the hash algorithm (e.g. "SHA-1", "SHA-256,...")
-
getEncryptionAlgorithm
String getEncryptionAlgorithm()Returns the encryption algorithm used for signing.- Returns:
- the encryption algorithm ("RSA" or "DSA")
-
sign
Signs it using the encryption algorithm in combination with the digest algorithm.- Parameters:
message
- the message you want to be hashed and signed- Returns:
- a signed message digest
- Throws:
GeneralSecurityException
-