iaik.me.security.rsa
Class RSASignature

java.lang.Object
  |
  +--iaik.me.security.Signature
        |
        +--iaik.me.security.rsa.RSASignature

public class RSASignature
extends Signature


Fields inherited from class iaik.me.security.Signature
md, random
 
Constructor Summary
RSASignature()
           
 
Method Summary
 void initSign(PrivateKey privateKey, SecureRandom random)
          Inits the RSASignature object for signing.
 void initVerify(PublicKey publicKey)
          Inits the RSASignature object for verifying a signature.
 byte[] sign()
          Creates an RSA signature.
 boolean verify(byte[] signature)
          Verifies a given signature and returns true if the signature can be verified.
 
Methods inherited from class iaik.me.security.Signature
getAlgorithm, getInstance, register, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSASignature

public RSASignature()
             throws CryptoException
Method Detail

initSign

public void initSign(PrivateKey privateKey,
                     SecureRandom random)
              throws CryptoException
Inits the RSASignature object for signing. Note: the
Overrides:
initSign in class Signature
Parameters:
privateKey - for signature
securerandomobject - for RNG
Throws:
CryptoException - if algorithm is not available

initVerify

public void initVerify(PublicKey publicKey)
                throws CryptoException
Inits the RSASignature object for verifying a signature.
Overrides:
initVerify in class Signature
Parameters:
publicKey -  
Throws:
CryptoException -  

verify

public boolean verify(byte[] signature)
               throws CryptoException
Verifies a given signature and returns true if the signature can be verified.
Overrides:
verify in class Signature
Parameters:
signature - as bytearray
Returns:
true if the signature is correct
Throws:
CryptoException -  

sign

public byte[] sign()
            throws CryptoException
Creates an RSA signature.
Overrides:
sign in class Signature
Returns:
signature as bytearry
Throws:
CryptoException -  

This Javadoc may contain text parts from IETF Internet Standard specifications, see copyright note) and RSA Data Security Public-Key Cryptography Standards (see copyright note).

IAIK-JCE ME 3.04, (c) 2002 IAIK, (c) 2003 to 2006 Stiftung SIC