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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getEncryptionAlgorithm()
Returns the encryption algorithm used for signing.java.lang.String
getHashAlgorithm()
Returns the hash algorithm.byte[]
sign(byte[] message)
Signs it using the encryption algorithm in combination with the digest algorithm.
-
-
-
Method Detail
-
getHashAlgorithm
java.lang.String getHashAlgorithm()
Returns the hash algorithm.- Returns:
- the hash algorithm (e.g. "SHA-1", "SHA-256,...")
-
getEncryptionAlgorithm
java.lang.String getEncryptionAlgorithm()
Returns the encryption algorithm used for signing.- Returns:
- the encryption algorithm ("RSA" or "DSA")
-
sign
byte[] sign(byte[] message) throws java.security.GeneralSecurityException
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:
java.security.GeneralSecurityException
-
-