public static enum Encryption.Cipher extends Enum<Encryption.Cipher> implements CipherAlgorithm
Enum Constant and Description |
---|
AES |
CHA_CHA_20 |
Modifier and Type | Method and Description |
---|---|
static CipherAlgorithm |
getCipherAlgorithm(UUID cipherUuid)
Find a cipher that matches this Uuid
|
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
|
String |
getName()
Return the name of this algorithm
|
static Encryption.Cipher |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Encryption.Cipher[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Encryption.Cipher CHA_CHA_20
public static final Encryption.Cipher AES
public static Encryption.Cipher[] values()
for (Encryption.Cipher c : Encryption.Cipher.values()) System.out.println(c);
public static Encryption.Cipher valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static CipherAlgorithm getCipherAlgorithm(UUID cipherUuid)
cipherUuid
- the UuidIllegalArgumentException
- if the Uuid is not knownpublic 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.