public class DHKey extends Object
Constructor and Description |
---|
DHKey()
Constructs the instance creating the server's key only.
|
Modifier and Type | Method and Description |
---|---|
void |
assignClientPublicKey(String publicKey)
Assigns the Client's public key.
|
byte[] |
decrypt(String clientPublicKey,
String encryptedString)
Decrypts an encoded string from the client using the two public keys.
|
static IvParameterSpec |
getIvParameterSpec()
Gets the IV parameter.
|
String |
getServerPublicKey()
Gets the Server's public key.
|
public DHKey()
public static IvParameterSpec getIvParameterSpec()
public void assignClientPublicKey(String publicKey)
publicKey
- The "Alice" public key as a hexadecimal number.IllegalArgumentException
- If the public key is invalid.public String getServerPublicKey()
public byte[] decrypt(String clientPublicKey, String encryptedString) throws InvalidKeyException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, UnsupportedEncodingException
clientPublicKey
- The client public key.encryptedString
- The encrypted string encoded as a Base 64 string.InvalidAlgorithmParameterException
InvalidKeyException
NoSuchPaddingException
NoSuchAlgorithmException
BadPaddingException
IllegalBlockSizeException
UnsupportedEncodingException
iizi® is a registered trademark of Mindus SARL. © Copyright Mindus SARL, 2020. All rights reserved.