issrg.security
Interface Signer

All Known Implementing Classes:
ACMDISSigningUtility, DefaultSecurity, DefaultSigningUtility, MultiFileTypeSecurity, PKCS12Security, Security, SigningUtility, SimpleSigningUtility

public interface Signer

This interface provides all the necessary methods for signing.

Author:
A Otenko

Method Summary
 java.lang.String getSigningAlgorithmID()
          This method returns the key-dependent Signing Algorithm used by the Signer.
 java.security.cert.X509Certificate getVerificationCertificate()
          This method lets the caller get the verification certificate so it can be provided in some form to the signature verifier, or can be used to extract the necessary data to form the correct signature information (signer's name, etc).
 byte[] sign(byte[] data)
          This method lets the caller sign any data and returns the signature of it.
 

Method Detail

sign

byte[] sign(byte[] data)
            throws SecurityException
This method lets the caller sign any data and returns the signature of it.

Parameters:
data - is the binary data to be signed
Returns:
a byte array of the signature
Throws:
SecurityException - if signing fails for whatever reason

getVerificationCertificate

java.security.cert.X509Certificate getVerificationCertificate()
                                                              throws SecurityException
This method lets the caller get the verification certificate so it can be provided in some form to the signature verifier, or can be used to extract the necessary data to form the correct signature information (signer's name, etc). If the user has got several signing certificates (and corresponding verification certificates), he must select the one to use at the login time, not at this point. This method should not display any GUI.

Returns:
the X509 PKC of the signer
Throws:
SecurityException - if the certificate cannot be returned (for example, a session is not open, or the certificate is not available)

getSigningAlgorithmID

java.lang.String getSigningAlgorithmID()
                                       throws SecurityException
This method returns the key-dependent Signing Algorithm used by the Signer. It is the OID of the algorithm in a dotted form (e.g. "1.2.840.113549.1.1.5" for SHA1withRSAEncryption).

Returns:
the String representation of the Signing Algorithm ID, as an OID
Throws:
SecurityException