public class DHSession extends Object
| Constructor and Description |
|---|
DHSession(boolean isServer)
Construct new Diffie-Hellman key exchange session
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(String cipherSpec,
String keySpec,
int blocksize,
byte[] encrypted) |
byte[] |
encrypt(String cipherSpec,
String keySpec,
int blocksize,
byte[] unencrypted) |
void |
finaliseKeyAgreement(String dhmessage) |
String |
getEncodedDHMaterial() |
public DHSession(boolean isServer)
throws InvalidAlgorithmParameterException,
NoSuchAlgorithmException,
InvalidKeyException,
NoSuchProviderException
InvalidAlgorithmParameterException - Invalid DH parameters (primes)NoSuchAlgorithmException - DH algorithm not available in VMInvalidKeyException - Private key generated by DH generator invalidNoSuchProviderException - Bouncy castle provider does not existpublic String getEncodedDHMaterial() throws IOException
IOExceptionpublic void finaliseKeyAgreement(String dhmessage) throws IOException, GeneralSecurityException, IllegalStateException
public byte[] decrypt(String cipherSpec, String keySpec, int blocksize, byte[] encrypted) throws InvalidKeyException, IllegalStateException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, NoSuchProviderException
public byte[] encrypt(String cipherSpec, String keySpec, int blocksize, byte[] unencrypted) throws InvalidKeyException, IllegalStateException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException, NoSuchProviderException
Copyright © 2011–2018 dCache.org. All rights reserved.