public class ChaCha extends Object implements CipherAlgorithm
A singleton
Modifier and Type | Method and Description |
---|---|
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 ChaCha |
getInstance() |
String |
getName()
Return the name of this algorithm
|
public static ChaCha getInstance()
public UUID getCipherUuid()
CipherAlgorithm
getCipherUuid
in interface CipherAlgorithm
public String getName()
CipherAlgorithm
getName
in interface CipherAlgorithm
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 ivCopyright © 2023. All rights reserved.