Class YYRSA

java.lang.Object
  extended by YYRSA

public final class YYRSA
extends java.lang.Object


Field Summary
static int CHUNK_LEN_BYTES
           
static int MODULUS_LEN_BYTES
           
static java.math.BigInteger RSA_E
           
static int RSA_PRIME_LEN_BYTES
           
static int RSA_PTEXT_LEN_BYTES
           
static int RSA_PUB_EXP
           
 
Constructor Summary
YYRSA(java.lang.String failreason)
           
 
Method Summary
 java.lang.String getfailurereason()
           
 boolean isvalid()
           
static void main(java.lang.String[] args)
           
static YYRSA readRSAFilePriv(java.lang.String alias, java.lang.String password)
           
static ReadRSAPubres readRSAFilePub(java.lang.String alias)
           
 YYRSAdecryption rsadecryption(ByteArray ctext)
           
static ByteArray rsaencryption(ByteArray ptext, ByteArray n, YYrandom yyrandomobj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RSA_PUB_EXP

public static final int RSA_PUB_EXP
See Also:
Constant Field Values

RSA_E

public static final java.math.BigInteger RSA_E

RSA_PRIME_LEN_BYTES

public static final int RSA_PRIME_LEN_BYTES
See Also:
Constant Field Values

MODULUS_LEN_BYTES

public static final int MODULUS_LEN_BYTES
See Also:
Constant Field Values

CHUNK_LEN_BYTES

public static final int CHUNK_LEN_BYTES
See Also:
Constant Field Values

RSA_PTEXT_LEN_BYTES

public static final int RSA_PTEXT_LEN_BYTES
See Also:
Constant Field Values
Constructor Detail

YYRSA

public YYRSA(java.lang.String failreason)
Method Detail

isvalid

public boolean isvalid()

getfailurereason

public java.lang.String getfailurereason()
                                  throws FeralcoreException
Throws:
FeralcoreException

rsaencryption

public static ByteArray rsaencryption(ByteArray ptext,
                                      ByteArray n,
                                      YYrandom yyrandomobj)
                               throws FeralcoreException,
                                      java.security.NoSuchAlgorithmException,
                                      java.io.FileNotFoundException,
                                      java.io.IOException
Throws:
FeralcoreException
java.security.NoSuchAlgorithmException
java.io.FileNotFoundException
java.io.IOException

rsadecryption

public YYRSAdecryption rsadecryption(ByteArray ctext)
                              throws FeralcoreException,
                                     java.security.NoSuchAlgorithmException
Throws:
FeralcoreException
java.security.NoSuchAlgorithmException

readRSAFilePub

public static ReadRSAPubres readRSAFilePub(java.lang.String alias)
                                    throws FeralcoreException,
                                           java.io.UnsupportedEncodingException,
                                           java.io.IOException,
                                           java.lang.CloneNotSupportedException
Throws:
FeralcoreException
java.io.UnsupportedEncodingException
java.io.IOException
java.lang.CloneNotSupportedException

readRSAFilePriv

public static YYRSA readRSAFilePriv(java.lang.String alias,
                                    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,
                                    java.lang.CloneNotSupportedException
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
java.lang.CloneNotSupportedException

main

public static void main(java.lang.String[] args)
                 throws FeralcoreException,
                        java.security.NoSuchAlgorithmException,
                        java.io.FileNotFoundException,
                        java.io.IOException,
                        java.lang.InterruptedException,
                        java.lang.CloneNotSupportedException,
                        javax.crypto.NoSuchPaddingException,
                        java.security.InvalidKeyException,
                        javax.crypto.IllegalBlockSizeException,
                        javax.crypto.BadPaddingException,
                        java.security.spec.InvalidKeySpecException
Throws:
FeralcoreException
java.security.NoSuchAlgorithmException
java.io.FileNotFoundException
java.io.IOException
java.lang.InterruptedException
java.lang.CloneNotSupportedException
javax.crypto.NoSuchPaddingException
java.security.InvalidKeyException
javax.crypto.IllegalBlockSizeException
javax.crypto.BadPaddingException
java.security.spec.InvalidKeySpecException