inescID.crypto
Class SigningTool

java.lang.Object
  extended byinescID.crypto.SigningTool
Direct Known Subclasses:
RSABlindSignature

public class SigningTool
extends java.lang.Object

Title:

Description:

Copyright: Copyright (c) 2002

Company Inesc-ID


Field Summary
static java.lang.String DEFAULT_SIGN_ALGORITHM
           
(package private)  java.security.Signature sign
           
 
Constructor Summary
SigningTool()
           
SigningTool(java.lang.String algorithm)
           
 
Method Summary
 void initSign(java.security.PrivateKey key)
           
 void initVerify(java.security.PublicKey key)
           
 void initVerify(java.security.PublicKey key, java.lang.String algorithm)
           
 byte[] sign(byte[] msg)
           
 java.security.SignedObject signObject(java.security.PrivateKey key, java.io.Serializable object)
           
 boolean verify(byte[] msg, byte[] signature)
           
 boolean verifyObject(java.security.PublicKey key, java.security.SignedObject object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SIGN_ALGORITHM

public static final java.lang.String DEFAULT_SIGN_ALGORITHM
See Also:
Constant Field Values

sign

java.security.Signature sign
Constructor Detail

SigningTool

public SigningTool()
            throws java.security.NoSuchAlgorithmException

SigningTool

public SigningTool(java.lang.String algorithm)
            throws java.security.NoSuchAlgorithmException
Method Detail

initSign

public void initSign(java.security.PrivateKey key)
              throws java.security.NoSuchAlgorithmException,
                     java.security.InvalidKeyException
Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException

sign

public byte[] sign(byte[] msg)
            throws java.security.SignatureException
Throws:
java.security.SignatureException

signObject

public java.security.SignedObject signObject(java.security.PrivateKey key,
                                             java.io.Serializable object)
                                      throws java.lang.Exception
Throws:
java.lang.Exception

initVerify

public void initVerify(java.security.PublicKey key)
                throws java.security.NoSuchAlgorithmException,
                       java.security.InvalidKeyException,
                       java.security.SignatureException
Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.SignatureException

initVerify

public void initVerify(java.security.PublicKey key,
                       java.lang.String algorithm)
                throws java.security.NoSuchAlgorithmException,
                       java.security.InvalidKeyException,
                       java.security.SignatureException
Throws:
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
java.security.SignatureException

verify

public boolean verify(byte[] msg,
                      byte[] signature)
               throws java.security.SignatureException
Throws:
java.security.SignatureException

verifyObject

public boolean verifyObject(java.security.PublicKey key,
                            java.security.SignedObject object)
                     throws java.lang.Exception
Throws:
java.lang.Exception