Class KeyLoader

java.lang.Object
  |
  +--KeyLoader

public class KeyLoader
extends java.lang.Object

KeyLoader is an IO interface used by RSA to load and save the keys and modulus associated with one user. Thus KeyLoader is user dependent, and its constructor asks for a username.

In fact, a user's public key is stored in the local directory in a file named "username.pub.key". As well for "username.pri.key" (user's private key) and "username.mod" (its modulus). The methods below do what their names tell.

Author:
E.Lemonnier & E.Nordenstam

Constructor Summary
KeyLoader(java.lang.String username)
          Create a KeyLoader for a given user.
 
Method Summary
 java.math.BigInteger loadModulus()
           
 java.math.BigInteger loadPrivateKey()
           
 java.math.BigInteger loadPublicKey()
           
 void saveModulus(java.math.BigInteger m)
           
 void savePrivateKey(java.math.BigInteger k)
           
 void savePublicKey(java.math.BigInteger k)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyLoader

public KeyLoader(java.lang.String username)
Create a KeyLoader for a given user.

Parameters:
username - a user name.
Method Detail

loadPublicKey

public java.math.BigInteger loadPublicKey()

loadPrivateKey

public java.math.BigInteger loadPrivateKey()

loadModulus

public java.math.BigInteger loadModulus()

savePublicKey

public void savePublicKey(java.math.BigInteger k)

savePrivateKey

public void savePrivateKey(java.math.BigInteger k)

saveModulus

public void saveModulus(java.math.BigInteger m)