public final class KeyGenerator
extends java.lang.Object
修飾子とタイプ | フィールド | 説明 |
---|---|---|
static int |
PUBKEY_EXPONENT_SIZE |
推奨されていません。
use getElGamalExponentSize() which allows override in the properties
|
コンストラクタ | 説明 |
---|---|
KeyGenerator(I2PAppContext context) |
修飾子とタイプ | メソッド | 説明 |
---|---|---|
java.lang.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.
|
java.lang.Object[] |
generateSigningKeypair() |
Generate a pair of DSA keys, where index 0 is a SigningPublicKey, and
index 1 is a SigningPrivateKey.
|
SimpleDataStructure[] |
generateSigningKeys() |
DSA-SHA1 only.
|
SimpleDataStructure[] |
generateSigningKeys(SigType type) |
Generic signature type, supports DSA, RSA, ECDSA, EdDSA
|
int |
getElGamalExponentSize() |
|
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) |
Usage: KeyGenerator [sigtype...]
|
boolean |
useLongElGamalExponent() |
@Deprecated 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 boolean useLongElGamalExponent()
public int getElGamalExponentSize()
public java.lang.Object[] generatePKIKeypair()
public SimpleDataStructure[] generatePKIKeys()
public static PublicKey getPublicKey(PrivateKey priv)
priv
- PrivateKey objectjava.lang.IllegalArgumentException
- on bad keypublic java.lang.Object[] generateSigningKeypair()
public SimpleDataStructure[] generateSigningKeys()
public SimpleDataStructure[] generateSigningKeys(SigType type) throws java.security.GeneralSecurityException
java.security.GeneralSecurityException
public static SigningPublicKey getSigningPublicKey(SigningPrivateKey priv)
priv
- a SigningPrivateKey objectjava.lang.IllegalArgumentException
- on bad key or unknown typepublic static void main(java.lang.String[] args)