inescID.crypto.blindSignatures
Class RSABlindSignature

java.lang.Object
  extended byinescID.crypto.SigningTool
      extended byinescID.crypto.blindSignatures.RSABlindSignature

public class RSABlindSignature
extends SigningTool

Title:

Description:

Copyright: Copyright (c) 2002

Company Inesc-ID


Field Summary
static java.lang.String DEFAULT_HASH_ALGORITHM
           
static java.lang.String DEFAULT_RANDOM_ALGORITHM
           
(package private)  int emLen
           
private static int KEY_SIZE_BITS
           
private static int KEY_SIZE_BYTES
           
(package private)  java.security.MessageDigest md
           
(package private)  java.math.BigInteger modulus
           
(package private)  EMSA_PKCS1_V1_5 pkcs1
           
(package private)  java.math.BigInteger privateExponent
           
(package private)  java.math.BigInteger publicExponent
           
(package private)  java.security.SecureRandom srandom
           
 
Fields inherited from class inescID.crypto.SigningTool
DEFAULT_SIGN_ALGORITHM
 
Constructor Summary
RSABlindSignature()
           
RSABlindSignature(java.lang.String algorithm)
           
 
Method Summary
private  java.math.BigInteger blindMessage(java.math.BigInteger msg, java.math.BigInteger bf)
           
 byte[] blindMessage(byte[] msg, byte[] bf)
           
private  java.math.BigInteger blindSign(java.math.BigInteger msg)
           
 byte[] blindSign(byte[] msg)
           
private  java.math.BigInteger generateBlindFactor()
           
 byte[] generateBlindFactorBytes()
           
private  java.math.BigInteger getMessagePadPKCS1(java.math.BigInteger msg)
           
private  byte[] getMessagePadPKCS1(byte[] msg)
           
 void initBlindEngine(java.security.interfaces.RSAPublicKey key)
           
 void initBlindEngine(java.security.interfaces.RSAPublicKey key, java.lang.String hash)
           
 void initBlindSign(java.security.interfaces.RSAPrivateKey key)
           
private  java.math.BigInteger unblindSignature(java.math.BigInteger blindmsg, java.math.BigInteger bf)
           
 byte[] unblindSignature(byte[] blindmsg, byte[] bf)
           
 boolean verifyBlindSignature(byte[] msg, byte[] signature)
           
 
Methods inherited from class inescID.crypto.SigningTool
initSign, initVerify, initVerify, sign, signObject, verify, verifyObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HASH_ALGORITHM

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

DEFAULT_RANDOM_ALGORITHM

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

KEY_SIZE_BITS

private static final int KEY_SIZE_BITS
See Also:
Constant Field Values

KEY_SIZE_BYTES

private static final int KEY_SIZE_BYTES
See Also:
Constant Field Values

modulus

java.math.BigInteger modulus

privateExponent

java.math.BigInteger privateExponent

publicExponent

java.math.BigInteger publicExponent

pkcs1

EMSA_PKCS1_V1_5 pkcs1

md

java.security.MessageDigest md

emLen

int emLen

srandom

java.security.SecureRandom srandom
Constructor Detail

RSABlindSignature

public RSABlindSignature()
                  throws java.security.NoSuchAlgorithmException

RSABlindSignature

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

initBlindSign

public void initBlindSign(java.security.interfaces.RSAPrivateKey key)

blindSign

private java.math.BigInteger blindSign(java.math.BigInteger msg)

blindSign

public byte[] blindSign(byte[] msg)

initBlindEngine

public void initBlindEngine(java.security.interfaces.RSAPublicKey key)
                     throws java.security.NoSuchAlgorithmException
Throws:
java.security.NoSuchAlgorithmException

initBlindEngine

public void initBlindEngine(java.security.interfaces.RSAPublicKey key,
                            java.lang.String hash)
                     throws java.security.NoSuchAlgorithmException
Throws:
java.security.NoSuchAlgorithmException

getMessagePadPKCS1

private byte[] getMessagePadPKCS1(byte[] msg)

getMessagePadPKCS1

private java.math.BigInteger getMessagePadPKCS1(java.math.BigInteger msg)

blindMessage

private java.math.BigInteger blindMessage(java.math.BigInteger msg,
                                          java.math.BigInteger bf)

blindMessage

public byte[] blindMessage(byte[] msg,
                           byte[] bf)

unblindSignature

private java.math.BigInteger unblindSignature(java.math.BigInteger blindmsg,
                                              java.math.BigInteger bf)

unblindSignature

public byte[] unblindSignature(byte[] blindmsg,
                               byte[] bf)

generateBlindFactor

private java.math.BigInteger generateBlindFactor()

generateBlindFactorBytes

public byte[] generateBlindFactorBytes()

verifyBlindSignature

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