org.bouncycastle.jcajce.spec.KEMParameterSpec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bcprov-jdk14 Show documentation
Show all versions of bcprov-jdk14 Show documentation
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms. This jar contains JCE provider and lightweight API for the Bouncy Castle Cryptography APIs for JDK 1.4.
package org.bouncycastle.jcajce.spec;
import java.security.spec.AlgorithmParameterSpec;
public class KEMParameterSpec
implements AlgorithmParameterSpec
{
private final String keyAlgorithmName;
private final int keySizeInBits;
public KEMParameterSpec(String keyAlgorithmName)
{
this(keyAlgorithmName, -1);
}
public KEMParameterSpec(String keyAlgorithmName, int keySizeInBits)
{
this.keyAlgorithmName = keyAlgorithmName;
this.keySizeInBits = keySizeInBits;
}
/**
* Return the name of the symmetric key algorithm for the key returned by this KEM.
*
* @return key algorithm name.
*/
public String getKeyAlgorithmName()
{
return keyAlgorithmName;
}
/**
* Return the key size in bits if specified, -1 indicates no preference.
*
* @return key size, or -1.
*/
public int getKeySizeInBits()
{
return keySizeInBits;
}
}