Class Rerandtransutil

java.lang.Object
  extended by Rerandtransutil

public final class Rerandtransutil
extends java.lang.Object


Field Summary
static ByteArray PREFIXBYTEARR
           
 
Method Summary
static ByteArray computererandtransprog(java.lang.String path, ByteArray message, ByteArray pubkey, java.lang.String alias, YYrandom yyrandomobj)
          Encrypts message using pubkey resulting in a rerandtrans program that can only be deciphered with the corresponding private key.
static ByteArray decryptrerandtransprog(ByteArray privkey, boolean verbose, ByteArray program, java.lang.String alias, YYrandom yyrandomobj, long t)
           
static Rerandisvalidres isvalidstring(java.lang.String in)
           
static ByteArray loadprivatekey(java.lang.String name, java.lang.String password)
           
static RRloadpub loadpublickey(java.lang.String name)
           
static void main()
           
static void poststring(ByteArray s, java.lang.String fullurl)
          poststring() can internally result in a ConnectException being thrown.
static java.lang.String rerandtranspubpath(java.lang.String alias)
          Returns the full path of the rerandtrans public key file of the user corresponding to alias.
static boolean yyrerandtransproghasbasicformat(boolean verbose, ByteArray program)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIXBYTEARR

public static final ByteArray PREFIXBYTEARR
Method Detail

loadprivatekey

public static ByteArray loadprivatekey(java.lang.String name,
                                       java.lang.String password)
                                throws FeralcoreException,
                                       java.security.NoSuchAlgorithmException,
                                       javax.crypto.NoSuchPaddingException,
                                       java.security.InvalidKeyException,
                                       java.security.spec.InvalidKeySpecException,
                                       java.io.UnsupportedEncodingException,
                                       java.io.IOException,
                                       javax.crypto.IllegalBlockSizeException,
                                       javax.crypto.BadPaddingException
Throws:
FeralcoreException
java.security.NoSuchAlgorithmException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
java.security.spec.InvalidKeySpecException
java.io.UnsupportedEncodingException
java.io.IOException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException

rerandtranspubpath

public static java.lang.String rerandtranspubpath(java.lang.String alias)
Returns the full path of the rerandtrans public key file of the user corresponding to alias.


loadpublickey

public static RRloadpub loadpublickey(java.lang.String name)
                               throws FeralcoreException,
                                      java.security.NoSuchAlgorithmException,
                                      java.io.UnsupportedEncodingException,
                                      java.io.IOException
Throws:
FeralcoreException
java.security.NoSuchAlgorithmException
java.io.UnsupportedEncodingException
java.io.IOException

computererandtransprog

public static ByteArray computererandtransprog(java.lang.String path,
                                               ByteArray message,
                                               ByteArray pubkey,
                                               java.lang.String alias,
                                               YYrandom yyrandomobj)
                                        throws FeralcoreException,
                                               java.io.FileNotFoundException,
                                               java.io.IOException,
                                               java.security.NoSuchAlgorithmException,
                                               java.lang.InterruptedException,
                                               java.lang.CloneNotSupportedException
Encrypts message using pubkey resulting in a rerandtrans program that can only be deciphered with the corresponding private key. The output of this member function is this rerandtrans program. The alias argument is not the alias of the recipient. It is used for logging and is typically the alias of the feralcore node that invokes this function. This helps disginguish feralcore node logs from one another when they run in the same file system. The path argument is also used only for logging.

Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException
java.security.NoSuchAlgorithmException
java.lang.InterruptedException
java.lang.CloneNotSupportedException

isvalidstring

public static Rerandisvalidres isvalidstring(java.lang.String in)

yyrerandtransproghasbasicformat

public static boolean yyrerandtransproghasbasicformat(boolean verbose,
                                                      ByteArray program)
                                               throws FeralcoreException,
                                                      java.io.FileNotFoundException,
                                                      java.io.IOException,
                                                      java.security.NoSuchAlgorithmException,
                                                      java.lang.InterruptedException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException
java.security.NoSuchAlgorithmException
java.lang.InterruptedException

decryptrerandtransprog

public static ByteArray decryptrerandtransprog(ByteArray privkey,
                                               boolean verbose,
                                               ByteArray program,
                                               java.lang.String alias,
                                               YYrandom yyrandomobj,
                                               long t)
                                        throws FeralcoreException,
                                               java.io.FileNotFoundException,
                                               java.io.IOException,
                                               java.security.NoSuchAlgorithmException,
                                               java.lang.InterruptedException
Throws:
FeralcoreException
java.io.FileNotFoundException
java.io.IOException
java.security.NoSuchAlgorithmException
java.lang.InterruptedException

poststring

public static void poststring(ByteArray s,
                              java.lang.String fullurl)
                       throws java.io.UnsupportedEncodingException,
                              java.io.IOException
poststring() can internally result in a ConnectException being thrown. This can occur intermitantly with some webservers. The current design chooses to fail quietly and return to the caller. However, it does record the problem in an error log.

Throws:
java.io.UnsupportedEncodingException
java.io.IOException

main

public static void main()
                 throws java.lang.Exception
Throws:
java.lang.Exception