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.- Author:
- Paulo Soares
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getEncryptionAlgorithm()
Returns the encryption algorithm used for signing.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
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
byte[] sign(byte[] message) throws 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:
GeneralSecurityException
-
-