| java.lang.Object | |
| ↳ | javax.crypto.KeyAgreement | 
This class provides the functionality for a key exchange protocol. This enables two or more parties to agree on a secret key for symmetric cryptography.
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  | 
           Creates a new 
            KeyAgreementinstance. | ||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  | 
           Does the next (or the last) phase of the key agreement, using the specified key.
           | ||||||||||
|  | 
           Generates the shared secret.
           | ||||||||||
|  | 
           Generates the shared secret and stores it into the buffer 
            sharedSecredatoffset. | ||||||||||
|  | 
           Generates the shared secret.
           | ||||||||||
|  | 
           Returns the name of the key agreement algorithm.
           | ||||||||||
|  | 
           Creates a new 
            KeyAgreementfor the specified algorithm from the specified provider. | ||||||||||
|  | 
           Create a new 
            KeyAgreementfor the specified algorithm from the specified provider. | ||||||||||
|  | 
           Creates a new 
            KeyAgreementfor the specified algorithm. | ||||||||||
|  | 
           Returns the provider for this 
            KeyAgreementinstance. | ||||||||||
|  | 
           Initializes this 
            KeyAgreementwith the specified key and the specified randomness source. | ||||||||||
|  | 
           Initializes this 
            KeyAgreementwith the specified key and the algorithm parameters. | ||||||||||
|  | 
           Initializes this 
            KeyAgreementwith the specified key, algorithm parameters and randomness source. | ||||||||||
|  | 
           Initializes this 
            KeyAgreementwith the specified key. | ||||||||||
| [Expand] 
           Inherited Methods
           | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class java.lang.Object | |||||||||||
Creates a new KeyAgreement instance.
| keyAgreeSpi | the SPI delegate. | 
|---|---|
| provider | the provider providing this KeyAgreement. | 
| algorithm | the name of the key agreement algorithm. | 
Does the next (or the last) phase of the key agreement, using the specified key.
| key | the key received from the other party for this phase. | 
|---|---|
| lastPhase | set to trueif this is the last phase of this key agreement. | 
null if there is no intermediate key for this phase.| InvalidKeyException | if the specified key cannot be used in this key agreement or this phase, | 
|---|---|
| IllegalStateException | if this instance has not been initialized. | 
Generates the shared secret.
| algorithm | the algorithm to for the SecretKey | 
|---|
SecretKey of the specified algorithm.| IllegalStateException | if this key agreement is not complete. | 
|---|---|
| NoSuchAlgorithmException | if the specified algorithm for the secret key does not exists. | 
| InvalidKeyException | if a SecretKeywith the specified algorithm cannot be created using the generated shared secret. | 
Generates the shared secret and stores it into the buffer sharedSecred at offset.
| sharedSecret | the buffer to store the shared secret. | 
|---|---|
| offset | the offset in the buffer. | 
| IllegalStateException | if this key agreement is not complete. | 
|---|---|
| ShortBufferException | if the specified buffer is too small for the shared secret. | 
Generates the shared secret.
| IllegalStateException | if this key agreement is not complete. | 
|---|
Returns the name of the key agreement algorithm.
Creates a new KeyAgreement for the specified algorithm from the specified provider.
| algorithm | the name of the key agreement algorithm to create. | 
|---|---|
| provider | the name of the provider that provides the requested algorithm. | 
| NoSuchAlgorithmException | if the specified provider cannot provide the requested algorithm. | 
|---|---|
| NoSuchProviderException | if the specified provider does not exist. | 
| IllegalArgumentException | if the specified provider name is nullor empty. | 
Create a new KeyAgreement for the specified algorithm from the specified provider.
| algorithm | the name of the key agreement algorithm to create. | 
|---|---|
| provider | the provider that provides the requested algorithm. | 
| NoSuchAlgorithmException | if the specified provider cannot provide the requested algorithm. | 
|---|---|
| IllegalArgumentException | if the specified provider is null. | 
| NullPointerException | if the specified algorithm name is null. | 
Creates a new KeyAgreement for the specified algorithm.
| algorithm | the name of the key agreement algorithm to create. | 
|---|
| NoSuchAlgorithmException | if no installed provider can provide the requested algorithm. | 
|---|---|
| NullPointerException | if the specified algorithm is null. | 
Returns the provider for this KeyAgreement instance.
KeyAgreement instance. Initializes this KeyAgreement with the specified key and the specified randomness source.
| key | the key to initialize this key agreement. | 
|---|---|
| random | the source for any randomness needed. | 
| InvalidKeyException | if the specified key cannot be used to initialize this key agreement. | 
|---|
Initializes this KeyAgreement with the specified key and the algorithm parameters.
| key | the key to initialize this key agreement. | 
|---|---|
| params | the parameters for this key agreement algorithm. | 
| InvalidKeyException | if the specified key cannot be used to initialize this key agreement. | 
|---|---|
| InvalidAlgorithmParameterException | if the specified parameters are invalid for this key agreement algorithm. | 
Initializes this KeyAgreement with the specified key, algorithm parameters and randomness source.
| key | the key to initialize this key agreement. | 
|---|---|
| params | the parameters for this key agreement algorithm. | 
| random | the source for any randomness needed. | 
| InvalidKeyException | if the specified key cannot be used to initialize this key agreement. | 
|---|---|
| InvalidAlgorithmParameterException | if the specified parameters are invalid for this key agreement algorithm. | 
Initializes this KeyAgreement with the specified key.
| key | the key to initialize this key agreement. | 
|---|
| InvalidKeyException | if the specified key cannot be used to initialize this key agreement. | 
|---|