com.friendshipsystems.fsshresourcemanager.config
Class FKeyPair

java.lang.Object
  extended by com.friendshipsystems.fsshresourcemanager.utils.FDBObject
      extended by com.friendshipsystems.fsshresourcemanager.config.FKeyPair

public class FKeyPair
extends com.friendshipsystems.fsshresourcemanager.utils.FDBObject

This class represents a RSA key pair stored in the database.

Author:
FRIENDSHIP SYSTEMS

Constructor Summary
FKeyPair()
           
FKeyPair(byte[] pub, byte[] priv)
           
 
Method Summary
static boolean checkExistence()
           
static boolean checkExistence(java.lang.String pubKeyFile, java.lang.String privKeyFile)
           
static FKeyPair getKeyPair(java.lang.String pass)
           
static FKeyPair getKeyPairFromFiles(java.lang.String pub, java.lang.String priv, java.lang.String pass)
           
 byte[] getPrivateKey()
           
 byte[] getPublicKey()
           
 java.lang.Boolean save(java.lang.String pass)
           
 void saveToFile(java.lang.String pub, java.lang.String priv, java.lang.String pass)
           
 java.util.Map<java.lang.String,java.lang.Object> toMap()
           
 
Methods inherited from class com.friendshipsystems.fsshresourcemanager.utils.FDBObject
delete, save, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FKeyPair

public FKeyPair(byte[] pub,
                byte[] priv)

FKeyPair

public FKeyPair()
Method Detail

getKeyPair

public static FKeyPair getKeyPair(java.lang.String pass)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getKeyPairFromFiles

public static FKeyPair getKeyPairFromFiles(java.lang.String pub,
                                           java.lang.String priv,
                                           java.lang.String pass)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

save

public java.lang.Boolean save(java.lang.String pass)
                       throws FInitalizeException
Throws:
FInitalizeException

toMap

public java.util.Map<java.lang.String,java.lang.Object> toMap()
Specified by:
toMap in class com.friendshipsystems.fsshresourcemanager.utils.FDBObject

saveToFile

public void saveToFile(java.lang.String pub,
                       java.lang.String priv,
                       java.lang.String pass)
                throws FInitalizeException
Throws:
FInitalizeException

getPublicKey

public byte[] getPublicKey()

getPrivateKey

public byte[] getPrivateKey()

checkExistence

public static boolean checkExistence(java.lang.String pubKeyFile,
                                     java.lang.String privKeyFile)
                              throws FInitalizeException
Throws:
FInitalizeException

checkExistence

public static boolean checkExistence()
                              throws FInitalizeException
Throws:
FInitalizeException