|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jcetaglib.lib.DHKeyAgreement
Diffie-Hellman key agreement
Constructor Summary | |
DHKeyAgreement()
|
Method Summary | |
static java.security.PublicKey |
bytesToPublicKey(byte[] keyBytes)
convert byte representation of a public key to a PublicKey object |
static java.security.KeyPair |
generateDHKeyPair()
Generate DH keypair based on SKIP Modulus |
static java.security.Key |
generateSessionKey(java.security.PublicKey pubkey,
java.security.PrivateKey privkey,
java.lang.String algorithm,
int length)
Create session key from DH keypair |
static byte[] |
publicKeyToBytes(java.security.PublicKey pub)
get a byte presentation of a PublicKey object |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DHKeyAgreement()
Method Detail |
public static java.security.KeyPair generateDHKeyPair() throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidAlgorithmParameterException
java.security.NoSuchAlgorithmException
- unknown algorithm
java.security.NoSuchProviderException
- unknown provider
java.security.InvalidAlgorithmParameterException
public static java.security.Key generateSessionKey(java.security.PublicKey pubkey, java.security.PrivateKey privkey, java.lang.String algorithm, int length) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
pubkey
- public key other partyprivkey
- own private keyalgorithm
- block cipher algorithmlength
- block cipher length in bits
java.security.NoSuchAlgorithmException
- unknown algorithm
java.security.InvalidKeyException
- key is not validpublic static byte[] publicKeyToBytes(java.security.PublicKey pub)
pub
- the public key
public static java.security.PublicKey bytesToPublicKey(byte[] keyBytes) throws java.security.NoSuchAlgorithmException, java.security.spec.InvalidKeySpecException
keyBytes
- byte representation of a public key
java.security.NoSuchAlgorithmException
- unknown algorithm
java.security.spec.InvalidKeySpecException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |