Package org.bouncycastle.crypto
Interface PasswordBasedDeriver<T>
-
- Type Parameters:
T
- the parameters type for the deriver.
- All Known Implementing Classes:
PBEParametersGenerator
public interface PasswordBasedDeriver<T>
Base interface for a password based deriver of bytes for symmetric keys.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
PasswordBasedDeriver.KeyType
The target key type we are trying to produce a key for.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
deriveKey(PasswordBasedDeriver.KeyType keyType, int keySizeInBytes)
Derive a key of the given keySizeInBytes length.byte[][]
deriveKeyAndIV(PasswordBasedDeriver.KeyType keyType, int keySizeInBytes, int ivSizeInBytes)
Derive a key of the given keySizeInBytes length and an iv of ivSizeInBytes length.T
getParameters()
Return the parameters for this deriver.
-
-
-
Method Detail
-
getParameters
T getParameters()
Return the parameters for this deriver.- Returns:
- the deriver's parameters.
-
deriveKey
byte[] deriveKey(PasswordBasedDeriver.KeyType keyType, int keySizeInBytes)
Derive a key of the given keySizeInBytes length.- Parameters:
keyType
- type of key to be calculated.keySizeInBytes
- the number of bytes to be produced.- Returns:
- a byte array containing the raw key data.
-
deriveKeyAndIV
byte[][] deriveKeyAndIV(PasswordBasedDeriver.KeyType keyType, int keySizeInBytes, int ivSizeInBytes)
Derive a key of the given keySizeInBytes length and an iv of ivSizeInBytes length.- Parameters:
keyType
- type of key to be calculated.keySizeInBytes
- the number of bytes to be produced.ivSizeInBytes
- the number of bytes to be produced.- Returns:
- a 2 element byte[] array containing the raw key data in element 0, the iv in element 1.
-
-