|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.crypt.asymmetric.PublicKeyUtils
public final class PublicKeyUtils
Utility methods for public and private keys used for asymmetric encryption.
| Method Summary | |
|---|---|
static KeyPair |
generate(String algorithm,
AlgorithmParameterSpec params)
Generates a key pair with precise control over algorithm parameters. |
static KeyPair |
generate(String algorithm,
AlgorithmParameterSpec params,
SecureRandom random)
Generates a key pair with precise control over algorithm parameters. |
static KeyPair |
generate(String algorithm,
int bitLength)
Generates a key pair of the given length with default algorithm parameters. |
static KeyPair |
generate(String algorithm,
int bitLength,
SecureRandom random)
Generates a key pair of the given length with default algorithm parameters. |
static boolean |
isKeyPair(PublicKey pubKey,
PrivateKey privKey)
Determines whether the given public and private keys form a proper key pair by computing and verifying a digital signature with the keys. |
static int |
length(PrivateKey privKey)
Gets the length in bits of a private key where key size is dependent on the particulars of the algorithm. |
static int |
length(PublicKey pubKey)
Gets the length in bits of a public key where key size is dependent on the particulars of the algorithm. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int length(PublicKey pubKey)
pubKey - Public key.
public static int length(PrivateKey privKey)
privKey - Private key.
public static KeyPair generate(String algorithm,
int bitLength)
throws CryptException
algorithm - Name of a cipher algorithm for which a suitable key pair
will be generated.bitLength - Size of each key in pair in bits.
CryptException - On key pair generation errors.
public static KeyPair generate(String algorithm,
int bitLength,
SecureRandom random)
throws CryptException
algorithm - Name of a cipher algorithm for which a suitable key pair
will be generated.bitLength - Size of each key in pair in bits.random - Source of randomness used for key generation.
CryptException - On key pair generation errors.
public static KeyPair generate(String algorithm,
AlgorithmParameterSpec params)
throws CryptException
algorithm - Name of a cipher algorithm for which a suitable key pair
will be generated.params - Algorithm-specific domain parameters.
CryptException - On key pair generation errors.
public static KeyPair generate(String algorithm,
AlgorithmParameterSpec params,
SecureRandom random)
throws CryptException
algorithm - Name of a cipher algorithm for which a suitable key pair
will be generated.params - Algorithm-specific domain parameters.random - Source of randomness used for key generation.
CryptException - On key pair generation errors.
public static boolean isKeyPair(PublicKey pubKey,
PrivateKey privKey)
pubKey - Public key.privKey - Private key.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||