JXTA

jxta.security.impl.signature
Class RSASignature

java.lang.Object
  |
  +--jxta.security.impl.signature.RSASignature

public class RSASignature
extends java.lang.Object
implements jxta.security.signature.Signature


Fields inherited from interface jxta.security.signature.Signature
ALG_NULL, ALG_RSA_MD5_PKCS1, ALG_RSA_SHA_PKCS1, MODE_SIGN, MODE_VERIFY, name
 
Constructor Summary
RSASignature()
          // constructor
RSASignature(jxta.security.publickey.PublicKeyAlgorithm rsaAlg, RSAKey theKey, byte theType, jxta.security.hash.Hash theDigest)
          constructor
 
Method Summary
 void clearDebug()
          turn off debugging
 byte getAlgorithm()
          // Algorithm type
 java.lang.String getAlgorithmName()
          // Algorithm name
 void init(byte theMode)
          initialize the Signature mode - sign or verify
 void setDebug()
          turn on debugging
 byte[] sign(byte[] inbuf, int offset, int inLength)
          Signs the hash generated from the last(only) buffer of data.
 void update(byte[] inbuf, int offset, int length)
          updates data to be signed.
 boolean verify(byte[] inBuf, int inOffset, int inLength, byte[] sigBuf, int sigOffset, int sigLength)
          Verifies a signature for last/only inBuf against the signature in sigBuf.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSASignature

public RSASignature()
// constructor

RSASignature

public RSASignature(jxta.security.publickey.PublicKeyAlgorithm rsaAlg,
                    RSAKey theKey,
                    byte theType,
                    jxta.security.hash.Hash theDigest)
constructor
Method Detail

getAlgorithmName

public java.lang.String getAlgorithmName()
// Algorithm name
Specified by:
getAlgorithmName in interface jxta.security.signature.Signature

getAlgorithm

public byte getAlgorithm()
// Algorithm type
Specified by:
getAlgorithm in interface jxta.security.signature.Signature

setDebug

public void setDebug()
turn on debugging

clearDebug

public void clearDebug()
turn off debugging

init

public void init(byte theMode)
          throws jxta.security.exceptions.CryptoException
initialize the Signature mode - sign or verify
Specified by:
init in interface jxta.security.signature.Signature

update

public void update(byte[] inbuf,
                   int offset,
                   int length)
            throws jxta.security.exceptions.CryptoException
updates data to be signed. Here, the data in inbuf is hashed with the digest.
Specified by:
update in interface jxta.security.signature.Signature

sign

public byte[] sign(byte[] inbuf,
                   int offset,
                   int inLength)
            throws jxta.security.exceptions.CryptoException
Signs the hash generated from the last(only) buffer of data.
Specified by:
sign in interface jxta.security.signature.Signature

verify

public boolean verify(byte[] inBuf,
                      int inOffset,
                      int inLength,
                      byte[] sigBuf,
                      int sigOffset,
                      int sigLength)
               throws jxta.security.exceptions.CryptoException
Verifies a signature for last/only inBuf against the signature in sigBuf. One can use update as with sign().
Specified by:
verify in interface jxta.security.signature.Signature

JXTA