|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--demo.RSACryptoManager
A collection of purpose built methods for encrypting secret shares and commitment values and signing messages.
The RSA CryptoManager requires the cryptix provider, version 3.2 or later. In order to run the ShareDemo, you must have cryptix installed properly in your classpath or specified on the command line.
| Constructor Summary | |
RSACryptoManager(Client client,
java.security.PrivateKey priv,
java.security.PublicKey[] pubs)
Creates a new instance of RSACryptoManager |
|
| Method Summary | |
protected java.math.BigInteger[] |
decrypt(byte[] cipherText)
Decrypts the ciphertext into two BigIntegers using the local private key and places them into an array. |
byte[] |
encrypt(Share share,
int shareNumber)
Encrypts the secret share and the commitment value from the supplied share with the specified public key using RSA encryption. |
static java.security.KeyPair |
generateKeyPair()
Generates an RSA key pair. |
protected byte[] |
sign(byte[] data)
Signs the data usa SHA-1 and RSA following PKCS#1 using the local private key. |
protected byte[] |
validate(byte[] messageBytes,
int senderShareNumber)
Verifies the signature with an attached message. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RSACryptoManager(Client client,
java.security.PrivateKey priv,
java.security.PublicKey[] pubs)
client - The parent client.priv - The private key of the client.pubs - An array of public keys for all clients| Method Detail |
public byte[] encrypt(Share share,
int shareNumber)
throws CryptoException
Encrypts the secret share and the commitment value from the supplied share with the specified public key using RSA encryption.
share - The share with the secret share and commitment values that are to be encrypted.shareNumber - The share number of the client whose public key should be used in the encryption.
byte array containing the encrypted version of the secret share and commitment value.
CryptoException - An indication of an error encrypting the information.
protected java.math.BigInteger[] decrypt(byte[] cipherText)
throws MalformedCryptoException,
CryptoException
Decrypts the ciphertext into two BigIntegers using the local private key and places them into an array.
cipherText - The ciphertext created by encrypt().
BigInteger array.
MalformedCryptoException - An indication of invalid ciphertext.
CryptoException - An indication of error during the decryption process.
protected byte[] sign(byte[] data)
throws CryptoException
Signs the data usa SHA-1 and RSA following PKCS#1 using the local private key.
data - The message data in a byte array.
byte array containing the serialized data and the digital signature.
CryptoException - An indication of an error during the signing process.
protected byte[] validate(byte[] messageBytes,
int senderShareNumber)
throws CryptoException,
MalformedCryptoException
Verifies the signature with an attached message.
messageBytes - The message.senderShareNumber - The share number of the sender
CryptoException - An indication of an error during the verification process.
MalformedCryptoException - An indication that the message has an invalid signature.public static java.security.KeyPair generateKeyPair()
Generates an RSA key pair.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||