All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.esec.signature.ExternalSignature Maven / Gradle / Ivy

The newest version!
package com.esec.signature;

import java.io.InputStream;
import java.security.GeneralSecurityException;

/**
 * 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.
 */
public interface ExternalSignature {
    
    /**
     * Returns the hash algorithm.
     * @return	the hash algorithm (e.g. "SHA-1", "SHA-256,...")
     */
    public String getHashAlgorithm();

    /**
     * Returns the encryption algorithm used for signing.
     * @return the encryption algorithm ("RSA" or "DSA")
     */
    public String getEncryptionAlgorithm();
	
    /**
     * Signs it using the encryption algorithm in combination with
     * the digest algorithm.
     * @param message	the message you want to be hashed and signed
     * @return	a signed message digest
     * @throws GeneralSecurityException
     */
    public byte[] sign(InputStream message) throws GeneralSecurityException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy