core
Class RSALib

java.lang.Object
  |
  +--core.RSALib

public class RSALib
extends java.lang.Object

This library realise the RSA/ECB/PKCS#1 encoding if given a provider of the RSA cipher which does not support any mode

Author:
Xavier Didelot

Constructor Summary
RSALib()
           
 
Method Summary
static byte[] RSAdec(byte[] in, java.security.interfaces.RSAKey k)
          Decrypt a given array of bytes with a given RSAKey
static byte[] RSAenc(byte[] in, java.security.interfaces.RSAKey k)
          Encrypt a given array of bytes with a given RSAKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RSALib

public RSALib()
Method Detail

RSAenc

public static byte[] RSAenc(byte[] in,
                            java.security.interfaces.RSAKey k)
                     throws java.lang.Exception
Encrypt a given array of bytes with a given RSAKey

Parameters:
in - array of bytes that have to be encrypted
k - key used for RSA encryption
Returns:
the array of bytes after encryption
Throws:
java.lang.Exception

RSAdec

public static byte[] RSAdec(byte[] in,
                            java.security.interfaces.RSAKey k)
                     throws java.lang.Exception
Decrypt a given array of bytes with a given RSAKey

Parameters:
in - array of bytes that have to be decrypted
k - key used for RSA decryption
Returns:
the array of bytes after decryption
Throws:
java.lang.Exception