opencard.opt.security
Class DSASignCredential

java.lang.Object
  |
  +--opencard.opt.security.DSASignCredential

public class DSASignCredential
extends java.lang.Object
implements PKACredential, SignCredential

Sample credential to perform a DSA signing operation. This credential does not hash a message nor pad input blocks which are too small. It only accepts data which matches the key's input length and performs the raw DSA algorithm. This credential can be used for external authentication.

See Also:
PKACredential, SignCredential

Field Summary
protected  java.security.Signature JCAsignature
           
protected  java.security.interfaces.DSAPrivateKey privKey
           
 
Constructor Summary
DSASignCredential(java.security.interfaces.DSAPrivateKey privateKey)
          Constructor using a DSA private key
 
Method Summary
 int getInputLength()
           
 byte[] sign(byte[] data)
          Compute a signature over a block of data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

privKey

protected java.security.interfaces.DSAPrivateKey privKey

JCAsignature

protected java.security.Signature JCAsignature
Constructor Detail

DSASignCredential

public DSASignCredential(java.security.interfaces.DSAPrivateKey privateKey)
Constructor using a DSA private key
Method Detail

sign

public byte[] sign(byte[] data)
            throws opencard.core.OpenCardRuntimeException
Compute a signature over a block of data.
Specified by:
sign in interface SignCredential
Parameters:
data - Data to be signed. Must have length getInputLength().
Throws:
opencard.core.OpenCardRuntimeException - Invalid input block length or invalid key.

getInputLength

public int getInputLength()
Specified by:
getInputLength in interface SignCredential