ami.security
Class AMIPKI
java.lang.Object
|
+--ami.security.AMIPKI
- public class AMIPKI
- extends Object
Provides code to use a generic PKI functionnalities:
- RSA keys generation
- RSA encoding/decoding
- Signatures
- Version:
- 1.0
- Author:
- Bertrand Florat
Method Summary |
static byte[] |
rsaDecode(byte[] bIn,
AMIRSAKey ark)
put your documentation comment here |
static byte[] |
rsaEncode(byte[] bIn,
AMIRSAKey ark)
Encode the given byte array using rsa algorithm
Caution: bIn ust be >0
bIn can be neg in some case. |
static Object[] |
rsaKeyGenerate()
Used to generate a set of public key/private key of 1024 bits
return an array with first element = public key, second=private key |
static Object[] |
rsaKeyGenerate(int iKeySize)
Used to generate a set of public key/private key of 1024 bits
return an array with first element = public key, second=private key |
static byte[] |
sign(byte[] bIn,
AMIPrivateKey apr)
Return a signature for the given String |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
iCertainty
private static final int iCertainty
RSA_KEY_SIZE
private static final int RSA_KEY_SIZE
AMIPKI
public AMIPKI()
rsaKeyGenerate
public static final Object[] rsaKeyGenerate(int iKeySize)
throws AMIException
- Used to generate a set of public key/private key of 1024 bits
return an array with first element = public key, second=private key
rsaKeyGenerate
public static final Object[] rsaKeyGenerate()
throws AMIException
- Used to generate a set of public key/private key of 1024 bits
return an array with first element = public key, second=private key
sign
public static final byte[] sign(byte[] bIn,
AMIPrivateKey apr)
- Return a signature for the given String
rsaEncode
public static final byte[] rsaEncode(byte[] bIn,
AMIRSAKey ark)
throws AMIException
- Encode the given byte array using rsa algorithm
Caution: bIn ust be >0
bIn can be neg in some case. It's why we only use absolute value of bIn
rsaDecode
public static final byte[] rsaDecode(byte[] bIn,
AMIRSAKey ark)
throws AMIException
- put your documentation comment here
- Parameters:
bIn
- ark
- - Returns:
- decoded data as byte array
- Throws:
AMIException
-