Methods Summary |
---|
public final java.security.Key | doPhase(java.security.Key key, boolean lastPhase)Does the next (or the last) phase of the key agreement, using the
specified key.
return spiImpl.engineDoPhase(key, lastPhase);
|
public final byte[] | generateSecret()Generates the shared secret.
return spiImpl.engineGenerateSecret();
|
public final int | generateSecret(byte[] sharedSecret, int offset)Generates the shared secret and stores it into the buffer {@code
sharedSecred} at {@code offset}.
return spiImpl.engineGenerateSecret(sharedSecret, offset);
|
public final javax.crypto.SecretKey | generateSecret(java.lang.String algorithm)Generates the shared secret.
return spiImpl.engineGenerateSecret(algorithm);
|
public final java.lang.String | getAlgorithm()Returns the name of the key agreement algorithm.
return algorithm;
|
public static final javax.crypto.KeyAgreement | getInstance(java.lang.String algorithm)Creates a new {@code KeyAgreement} for the specified algorithm.
if (algorithm == null) {
throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
}
synchronized (engine) {
engine.getInstance(algorithm, null);
return new KeyAgreement((KeyAgreementSpi) engine.spi, engine.provider,
algorithm);
}
|
public static final javax.crypto.KeyAgreement | getInstance(java.lang.String algorithm, java.lang.String provider)Creates a new {@code KeyAgreement} for the specified algorithm from the
specified provider.
if ((provider == null) || (provider.length() == 0)) {
throw new IllegalArgumentException(Messages.getString("crypto.03")); //$NON-NLS-1$
}
Provider impProvider = Security.getProvider(provider);
if (impProvider == null) {
throw new NoSuchProviderException(provider);
}
return getInstance(algorithm, impProvider);
|
public static final javax.crypto.KeyAgreement | getInstance(java.lang.String algorithm, java.security.Provider provider)Create a new {@code KeyAgreement} for the specified algorithm from the
specified provider.
if (provider == null) {
throw new IllegalArgumentException(Messages.getString("crypto.04")); //$NON-NLS-1$
}
if (algorithm == null) {
throw new NullPointerException(Messages.getString("crypto.02")); //$NON-NLS-1$
}
synchronized (engine) {
engine.getInstance(algorithm, provider, null);
return new KeyAgreement((KeyAgreementSpi) engine.spi, provider,
algorithm);
}
|
public final java.security.Provider | getProvider()Returns the provider for this {@code KeyAgreement} instance.
return provider;
|
public final void | init(java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random)Initializes this {@code KeyAgreement} with the specified key, algorithm
parameters and randomness source.
spiImpl.engineInit(key, params, random);
|
public final void | init(java.security.Key key)Initializes this {@code KeyAgreement} with the specified key.
spiImpl.engineInit(key, rndm);//new SecureRandom());
|
public final void | init(java.security.Key key, java.security.SecureRandom random)Initializes this {@code KeyAgreement} with the specified key and the
specified randomness source.
spiImpl.engineInit(key, random);
|
public final void | init(java.security.Key key, java.security.spec.AlgorithmParameterSpec params)Initializes this {@code KeyAgreement} with the specified key and the
algorithm parameters.
spiImpl.engineInit(key, params, rndm);//new SecureRandom());
|