Package org.bouncycastle.crypto.general
Class ChaCha20.OperatorFactory
java.lang.Object
org.bouncycastle.crypto.general.ChaCha20.OperatorFactory
- All Implemented Interfaces:
SymmetricOperatorFactory<ChaCha20.Parameters>
- Enclosing class:
- ChaCha20
Factory for basic ChaCha20 encryption/decryption operators.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.bouncycastle.crypto.internal.StreamCipher
createCipher
(boolean forEncryption, SymmetricKey key, ChaCha20.Parameters parameters, SecureRandom random) createInputDecryptor
(SymmetricKey key, ChaCha20.Parameters parameters) Return a decryptor that operates on an input stream.createOutputDecryptor
(SymmetricKey key, ChaCha20.Parameters parameters) Return a decryptor that operates on an output stream.createOutputEncryptor
(SymmetricKey key, ChaCha20.Parameters parameters) Return an encryptor that operates on an output stream.
-
Constructor Details
-
OperatorFactory
public OperatorFactory()
-
-
Method Details
-
createCipher
protected org.bouncycastle.crypto.internal.StreamCipher createCipher(boolean forEncryption, SymmetricKey key, ChaCha20.Parameters parameters, SecureRandom random) -
createOutputEncryptor
public final OutputEncryptor<ChaCha20.Parameters> createOutputEncryptor(SymmetricKey key, ChaCha20.Parameters parameters) Description copied from interface:SymmetricOperatorFactory
Return an encryptor that operates on an output stream.- Specified by:
createOutputEncryptor
in interfaceSymmetricOperatorFactory<T extends Parameters>
- Parameters:
key
- the key to initialize the encryptor with.parameters
- the parameters to use to initialize the encryptor.- Returns:
- an OutputEncryptor
-
createOutputDecryptor
public OutputDecryptor<ChaCha20.Parameters> createOutputDecryptor(SymmetricKey key, ChaCha20.Parameters parameters) Description copied from interface:SymmetricOperatorFactory
Return a decryptor that operates on an output stream.- Specified by:
createOutputDecryptor
in interfaceSymmetricOperatorFactory<T extends Parameters>
- Parameters:
key
- the key to initialize the encryptor with.parameters
- the parameters to use to initialize the encryptor.- Returns:
- an OutputDecryptor.
-
createInputDecryptor
public final InputDecryptor<ChaCha20.Parameters> createInputDecryptor(SymmetricKey key, ChaCha20.Parameters parameters) Description copied from interface:SymmetricOperatorFactory
Return a decryptor that operates on an input stream.- Specified by:
createInputDecryptor
in interfaceSymmetricOperatorFactory<T extends Parameters>
- Parameters:
key
- the key to initialize the encryptor with.parameters
- the parameters to use to initialize the encryptor.- Returns:
- an InputDecryptor.
-