issrg.acm.extensions
Class SimpleSigningUtility
java.lang.Object
issrg.acm.SigningUtility
issrg.acm.extensions.SimpleSigningUtility
- All Implemented Interfaces:
- Utility, Signer
- Direct Known Subclasses:
- ACMDISSigningUtility
public class SimpleSigningUtility
- extends SigningUtility
This is a Signing Utility that uses files with PKCS#8 encoded private keys to sign and BER-encoded
X.509 PKCs to get the signer information.
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). |
boolean |
isLoggedIn()
|
void |
login(java.awt.Frame f,
java.util.Map m)
|
void |
logout(java.awt.Frame f,
java.util.Map m)
|
byte[] |
sign(byte[] b)
This method lets the caller sign any data and returns the signature of it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleSigningUtility
public SimpleSigningUtility()
getSigningAlgorithmID
public java.lang.String getSigningAlgorithmID()
throws SecurityException
- Description copied from interface:
Signer
- 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
logout
public void logout(java.awt.Frame f,
java.util.Map m)
- Specified by:
logout
in class SigningUtility
sign
public byte[] sign(byte[] b)
throws SecurityException
- Description copied from interface:
Signer
- This method lets the caller sign any data and returns the signature of it.
- Parameters:
b
- is the binary data to be signed
- Returns:
- a byte array of the signature
- Throws:
SecurityException
- if signing fails for whatever reason
getVerificationCertificate
public java.security.cert.X509Certificate getVerificationCertificate()
throws SecurityException
- Description copied from interface:
Signer
- 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)
isLoggedIn
public boolean isLoggedIn()
login
public void login(java.awt.Frame f,
java.util.Map m)
throws SecurityException
- Specified by:
login
in class SigningUtility
- Throws:
SecurityException