public class KeyAgreementHelper extends Object
KeyAgreement
class. By default KeyAgreementHelper.KeyAgreementAlgorithm.ECDH
is used for the algorithm (ECDH).Modifier and Type | Class and Description |
---|---|
static class |
KeyAgreementHelper.KeyAgreementAlgorithm
This enumeration represents the key agreement algorithms that Absio knowingly supports.
|
Constructor and Description |
---|
KeyAgreementHelper()
Create the helper with
KeyAgreementHelper.KeyAgreementAlgorithm.ECDH . |
KeyAgreementHelper(KeyAgreementHelper.KeyAgreementAlgorithm algorithm)
Create the helper with the given
KeyAgreementHelper.KeyAgreementAlgorithm . |
Modifier and Type | Method and Description |
---|---|
byte[] |
generateSharedSecret(PrivateKey privateKey,
PublicKey publicKey)
Generate the Diffie Hellman shared secret with the given private and public keys.
|
public KeyAgreementHelper() throws NoSuchAlgorithmException
KeyAgreementHelper.KeyAgreementAlgorithm.ECDH
.NoSuchAlgorithmException
- thrown if KeyAgreementHelper.KeyAgreementAlgorithm.ECDH
is not supportedpublic KeyAgreementHelper(KeyAgreementHelper.KeyAgreementAlgorithm algorithm) throws NoSuchAlgorithmException
KeyAgreementHelper.KeyAgreementAlgorithm
.algorithm
- the KeyAgreementHelper.KeyAgreementAlgorithm
NoSuchAlgorithmException
- thrown if the given KeyAgreementHelper.KeyAgreementAlgorithm
is not supportedpublic byte[] generateSharedSecret(PrivateKey privateKey, PublicKey publicKey) throws InvalidKeyException
KeyAgreement
with the helper's KeyAgreementHelper.KeyAgreementAlgorithm
.privateKey
- the private keypublicKey
- the public keyInvalidKeyException
- thrown if either of the keys do match the KeyAgreementHelper.KeyAgreementAlgorithm
Copyright © 2021. All rights reserved.