Constructor and Description |
---|
KeyAgreementPeer(javax.crypto.KeyAgreement keyAgreement)
Constructs a key agreement peer.
|
KeyAgreementPeer(javax.crypto.KeyAgreement keyAgreement,
java.security.KeyPair keyPair)
Constructs a key agreement peer.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
computeSharedSecret(java.security.Key key)
Computes the shared secret using the other peer's public key.
|
javax.crypto.KeyAgreement |
getKeyAgreement()
Returns this peer's
KeyAgreement instance. |
java.security.Key |
getPublicKey()
Returns this peer's public key.
|
public KeyAgreementPeer(javax.crypto.KeyAgreement keyAgreement) throws java.security.GeneralSecurityException
Constructs a key agreement peer.
keyAgreement
- java.security.GeneralSecurityException
public KeyAgreementPeer(javax.crypto.KeyAgreement keyAgreement, java.security.KeyPair keyPair) throws java.security.GeneralSecurityException
Constructs a key agreement peer.
keyAgreement
- keyPair
- java.security.GeneralSecurityException
public byte[] computeSharedSecret(java.security.Key key) throws java.security.InvalidKeyException
Computes the shared secret using the other peer's public key.
key
- java.security.InvalidKeyException
public java.security.Key getPublicKey()
Returns this peer's public key.
public javax.crypto.KeyAgreement getKeyAgreement()
Returns this peer's KeyAgreement
instance.