Interface IExternalSignature

All Known Implementing Classes:
PrivateKeySignature

public interface IExternalSignature
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

    Modifier and Type
    Method
    Description
    Returns the encryption algorithm used for signing.
    Returns the hash algorithm.
    byte[]
    sign(byte[] message)
    Signs the given message using the encryption algorithm in combination with the hash 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

      byte[] sign (byte[] message) throws GeneralSecurityException
      Signs the given message using the encryption algorithm in combination with the hash algorithm.
      Parameters:
      message - The message you want to be hashed and signed.
      Returns:
      A signed message digest.
      Throws:
      GeneralSecurityException - when requested cryptographic algorithm or security provider is not available