public class Aes extends Object implements CipherAlgorithm, KeyDerivationFunction
The class is a singleton
Modifier and Type | Class and Description |
---|---|
static class |
Aes.KdfKeys
v4 variant dictionary keys for use of AES as the KDF
|
Modifier and Type | Method and Description |
---|---|
VariantDictionary |
createKdfParameters()
get a copy of the Aes Variant dictionary
|
UUID |
getCipherUuid()
Returns the UUID of this algorithm
|
InputStream |
getDecryptedInputStream(InputStream encryptedInputStream,
byte[] key,
byte[] iv)
Create a decrypted stream from the supplied encrypted one
|
OutputStream |
getEncryptedOutputStream(OutputStream decryptedOutputStream,
byte[] key,
byte[] iv)
Create an encrypted stream from the supplied unencrypted one
|
static Aes |
getInstance() |
UUID |
getKdfUuid()
The UUID of this key derivation function
|
String |
getName()
Return the name of this algorithm
|
static byte[] |
getTransformedKey(byte[] key,
byte[] transformSeed,
long transformRounds)
Simplified version for KDBX V3
|
byte[] |
getTransformedKey(byte[] key,
VariantDictionary transformParams)
Transform a key using this key derivation function
|
public static Aes getInstance()
public VariantDictionary createKdfParameters()
createKdfParameters
in interface KeyDerivationFunction
public UUID getCipherUuid()
CipherAlgorithm
getCipherUuid
in interface CipherAlgorithm
public String getName()
CipherAlgorithm
getName
in interface CipherAlgorithm
getName
in interface KeyDerivationFunction
public InputStream getDecryptedInputStream(InputStream encryptedInputStream, byte[] key, byte[] iv)
CipherAlgorithm
getDecryptedInputStream
in interface CipherAlgorithm
encryptedInputStream
- an encrypted streamkey
- the decryption keyiv
- the ivpublic OutputStream getEncryptedOutputStream(OutputStream decryptedOutputStream, byte[] key, byte[] iv)
CipherAlgorithm
getEncryptedOutputStream
in interface CipherAlgorithm
decryptedOutputStream
- an unencrypted streamkey
- a keyiv
- an ivpublic UUID getKdfUuid()
KeyDerivationFunction
getKdfUuid
in interface KeyDerivationFunction
public byte[] getTransformedKey(byte[] key, VariantDictionary transformParams)
KeyDerivationFunction
getTransformedKey
in interface KeyDerivationFunction
key
- the key to transformtransformParams
- the parameters defining the way the transformation is to be carried outpublic static byte[] getTransformedKey(byte[] key, byte[] transformSeed, long transformRounds)
key
- the composite keytransformSeed
- the seedtransformRounds
- number of roundsCopyright © 2023. All rights reserved.