![JAR search and dependency download from the Maven repository](/logo.png)
org.bouncycastle.crypto.PasswordBasedDeriver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bc-fips-debug Show documentation
Show all versions of bc-fips-debug Show documentation
The FIPS 140-2 Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms certified to FIPS 140-2 level 1. This jar contains the debug version JCE provider and low-level API for the BC-FJA version 1.0.2.3, FIPS Certificate #3514. Please note the debug jar is not certified.
package org.bouncycastle.crypto;
/**
* Base interface for a password based deriver of bytes for symmetric keys.
*
* @param the parameters type for the deriver.
*/
public interface PasswordBasedDeriver
{
/**
* The target key type we are trying to produce a key for.
*/
static enum KeyType
{
/**
* Target key for a symmetric cipher.
*/
CIPHER,
/**
* Target key for a MAC.
*/
MAC,
}
/**
* Return the parameters for this deriver.
*
* @return the deriver's parameters.
*/
T getParameters();
/**
* Derive a key of the given keySizeInBytes length.
*
* @param keyType type of key to be calculated.
* @param keySizeInBytes the number of bytes to be produced.
* @return a byte array containing the raw key data.
*/
byte[] deriveKey(KeyType keyType, int keySizeInBytes);
/**
* Derive a key of the given keySizeInBytes length and an iv of ivSizeInBytes length.
*
* @param keyType type of key to be calculated.
* @param keySizeInBytes the number of bytes to be produced.
* @param ivSizeInBytes the number of bytes to be produced.
* @return a 2 element byte[] array containing the raw key data in element 0, the iv in element 1.
*/
byte[][] deriveKeyAndIV(KeyType keyType, int keySizeInBytes, int ivSizeInBytes);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy