|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.crypto.KeyGenerator
public class KeyGenerator
Define a way of generating asymetrical key pairs as well as symetrical keys
Field Summary | |
---|---|
static int |
PUBKEY_EXPONENT_SIZE
|
Constructor Summary | |
---|---|
KeyGenerator(I2PAppContext context)
|
Method Summary | |
---|---|
java.lang.Object[] |
generatePKIKeypair()
Generate a pair of keys, where index 0 is a PublicKey, and index 1 is a PrivateKey |
SessionKey |
generateSessionKey()
Generate a private 256 bit session key |
SessionKey |
generateSessionKey(byte[] salt,
byte[] passphrase)
PBE the passphrase with the salt |
java.lang.Object[] |
generateSigningKeypair()
Generate a pair of DSA keys, where index 0 is a SigningPublicKey, and index 1 is a SigningPrivateKey |
static KeyGenerator |
getInstance()
|
static PublicKey |
getPublicKey(PrivateKey priv)
Convert a PrivateKey to its corresponding PublicKey |
static SigningPublicKey |
getSigningPublicKey(SigningPrivateKey priv)
Convert a SigningPrivateKey to a SigningPublicKey |
static void |
main(java.lang.String[] args)
|
(package private) static byte[] |
padBuffer(byte[] src,
int length)
Pad the buffer w/ leading 0s or trim off leading bits so the result is the given length. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PUBKEY_EXPONENT_SIZE
Constructor Detail |
---|
public KeyGenerator(I2PAppContext context)
Method Detail |
---|
public static KeyGenerator getInstance()
public SessionKey generateSessionKey()
public SessionKey generateSessionKey(byte[] salt, byte[] passphrase)
public java.lang.Object[] generatePKIKeypair()
public static PublicKey getPublicKey(PrivateKey priv)
priv
- PrivateKey object
public java.lang.Object[] generateSigningKeypair()
public static SigningPublicKey getSigningPublicKey(SigningPrivateKey priv)
priv
- a SigningPrivateKey object
static final byte[] padBuffer(byte[] src, int length)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |