net.i2p.crypto
public class KeyGenerator extends Object
Modifier and Type | Field and Description |
---|---|
static int |
PUBKEY_EXPONENT_SIZE |
Constructor and Description |
---|
KeyGenerator(I2PAppContext context) |
Modifier and Type | Method and Description |
---|---|
Object[] |
generatePKIKeypair()
Generate a pair of keys, where index 0 is a PublicKey, and
index 1 is a PrivateKey
|
SimpleDataStructure[] |
generatePKIKeys()
Same as above but different return type
|
SessionKey |
generateSessionKey()
Generate a private 256 bit session key
|
SessionKey |
generateSessionKey(byte[] salt,
byte[] passphrase)
PBE the passphrase with the salt
|
Object[] |
generateSigningKeypair()
Generate a pair of DSA keys, where index 0 is a SigningPublicKey, and
index 1 is a SigningPrivateKey
|
SimpleDataStructure[] |
generateSigningKeys()
Same as above but different return type
|
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
|
public static final int PUBKEY_EXPONENT_SIZE
public KeyGenerator(I2PAppContext context)
public static KeyGenerator getInstance()
public SessionKey generateSessionKey()
public SessionKey generateSessionKey(byte[] salt, byte[] passphrase)
public Object[] generatePKIKeypair()
public SimpleDataStructure[] generatePKIKeys()
public static PublicKey getPublicKey(PrivateKey priv)
priv
- PrivateKey objectpublic Object[] generateSigningKeypair()
public SimpleDataStructure[] generateSigningKeys()
public static SigningPublicKey getSigningPublicKey(SigningPrivateKey priv)
priv
- a SigningPrivateKey object