Package org.bouncycastle.crypto
Interface PasswordBasedDeriver<T>
- Type Parameters:
T
- the parameters type for the deriver.
public interface PasswordBasedDeriver<T>
Base interface for a password based deriver of bytes for symmetric keys.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The target key type we are trying to produce a key for. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
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.Return the parameters for this deriver.
-
Method Details
-
getParameters
T getParameters()Return the parameters for this deriver.- Returns:
- the deriver's parameters.
-
deriveKey
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.
-