public class RSAKey
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BEGINPRIVATEKEY |
static java.lang.String |
BEGINPUBLICKEY |
static java.lang.String |
ENDPRIVATEKEY |
static java.lang.String |
ENDPUBLICKEY |
static java.lang.Byte |
RSABYTE |
static int |
SAFESIZE |
static java.lang.String |
TAG |
| Constructor and Description |
|---|
RSAKey(java.math.BigInteger N) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.StringBuilder |
decrypt(java.math.BigInteger message)
Performs the classical RSA computation.
|
java.lang.StringBuilder |
decrypt(java.lang.String message) |
java.math.BigInteger |
encrypt(java.math.BigInteger message)
Performs the classical RSA computation.
|
java.lang.StringBuilder |
encrypt(java.lang.String value)
Performs the classical RSA computation.
|
java.lang.StringBuilder |
encrypt(java.lang.String value,
int group) |
static RSAKey |
generateKey() |
static RSAKey |
generateKey(java.math.BigInteger p,
java.math.BigInteger q,
int max) |
static RSAKey |
generateKey(int max) |
static RSAKey |
generateKey(int p,
int q,
int max) |
static RSAKey |
getDecryptKey(java.math.BigInteger n,
java.math.BigInteger privateKey) |
java.math.BigInteger |
getModulus() |
java.math.BigInteger |
getPrivateKey() |
DERBuffer |
getPrivateStream() |
java.math.BigInteger |
getPublicKey() |
DERBuffer |
getPublicStream() |
DERBuffer |
getStream(java.math.BigInteger key) |
Entity |
sign(Entity value) |
java.lang.String |
toString() |
RSAKey |
withPrivateKey(java.math.BigInteger value) |
RSAKey |
withPubExp(java.math.BigInteger value)
Sets the public exponent.
|
RSAKey |
withPubExp(int value)
Sets the public exponent.
|
RSAKey |
withPublicKey(java.math.BigInteger value) |
public static final java.lang.String BEGINPUBLICKEY
public static final java.lang.String ENDPUBLICKEY
public static final java.lang.String BEGINPRIVATEKEY
public static final java.lang.String ENDPRIVATEKEY
public static final java.lang.Byte RSABYTE
public static final int SAFESIZE
public static final java.lang.String TAG
public RSAKey withPublicKey(java.math.BigInteger value)
public java.math.BigInteger getPublicKey()
public RSAKey withPrivateKey(java.math.BigInteger value)
public java.math.BigInteger getPrivateKey()
public java.math.BigInteger getModulus()
public RSAKey withPubExp(java.math.BigInteger value)
value - The the Public Exponentpublic RSAKey withPubExp(int value)
value - The the Public Exponentpublic java.math.BigInteger encrypt(java.math.BigInteger message)
message - Encrypt a Messagepublic java.lang.StringBuilder encrypt(java.lang.String value)
value - Enscript the Valuepublic java.lang.StringBuilder decrypt(java.lang.String message)
public java.lang.StringBuilder decrypt(java.math.BigInteger message)
message - Message to descryptpublic java.lang.StringBuilder encrypt(java.lang.String value,
int group)
public static RSAKey generateKey(int p, int q, int max)
public static RSAKey generateKey()
public static RSAKey generateKey(int max)
public static RSAKey generateKey(java.math.BigInteger p, java.math.BigInteger q, int max)
public static RSAKey getDecryptKey(java.math.BigInteger n, java.math.BigInteger privateKey)
public java.lang.String toString()
toString in class java.lang.Objectpublic DERBuffer getPublicStream()
public DERBuffer getPrivateStream()
public DERBuffer getStream(java.math.BigInteger key)