public enum BuiltinCiphers extends Enum<BuiltinCiphers> implements CipherFactory
Modifier and Type | Class and Description |
---|---|
static class |
BuiltinCiphers.Constants |
static class |
BuiltinCiphers.ParseResult
Holds the result of
parseCiphersList(String) |
Enum Constant and Description |
---|
aes128cbc |
aes128ctr |
aes128gcm |
aes192cbc |
aes192ctr |
aes256cbc |
aes256ctr |
aes256gcm |
arcfour128
Deprecated.
|
arcfour256
Deprecated.
|
blowfishcbc
Deprecated.
|
cc20p1305_openssh |
none |
tripledescbc
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
static Set<BuiltinCiphers> |
VALUES |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
FALSE, TRUE
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
setUpFactories
create, setUpBuiltinFactories, setUpTransformedFactories
findByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByName
all, any, of
public static final BuiltinCiphers none
public static final BuiltinCiphers aes128cbc
public static final BuiltinCiphers aes128ctr
public static final BuiltinCiphers aes128gcm
public static final BuiltinCiphers aes256gcm
public static final BuiltinCiphers aes192cbc
public static final BuiltinCiphers aes192ctr
public static final BuiltinCiphers aes256cbc
public static final BuiltinCiphers aes256ctr
@Deprecated public static final BuiltinCiphers arcfour128
@Deprecated public static final BuiltinCiphers arcfour256
@Deprecated public static final BuiltinCiphers blowfishcbc
public static final BuiltinCiphers cc20p1305_openssh
@Deprecated public static final BuiltinCiphers tripledescbc
public static final Set<BuiltinCiphers> VALUES
public static BuiltinCiphers[] values()
for (BuiltinCiphers c : BuiltinCiphers.values()) System.out.println(c);
public static BuiltinCiphers 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 final String getName()
getName
in interface NamedResource
public final String toString()
toString
in class Enum<BuiltinCiphers>
public boolean isSupported()
isSupported
in interface OptionalFeature
true
if the current JVM configuration supports this cipher - e.g., AES-256 requires the
Java Cryptography Extension (JCE)public int getKeySize()
getKeySize
in interface KeySizeIndicator
public int getIVSize()
getIVSize
in interface CipherInformation
public int getAuthenticationTagSize()
getAuthenticationTagSize
in interface CipherInformation
public int getKdfSize()
getKdfSize
in interface CipherInformation
public int getCipherBlockSize()
getCipherBlockSize
in interface CipherInformation
public String getAlgorithm()
getAlgorithm
in interface AlgorithmNameProvider
public String getTransformation()
getTransformation
in interface CipherInformation
public Cipher create()
public static void registerExtension(CipherFactory extension)
NamedFactory
to be available besides the built-in ones when parsing configurationextension
- The factory to registerIllegalArgumentException
- if factory instance is null
, or overrides a built-in one or overrides
another registered factory with the same name (case insensitive).public static NavigableSet<CipherFactory> getRegisteredExtensions()
SortedSet
of the currently registered extensions, sorted according to the factory name (case
insensitive)public static NamedFactory<Cipher> unregisterExtension(String name)
name
- The factory name - ignored if null
/emptynull
if not foundpublic static BuiltinCiphers fromString(String s)
s
- The Enum
's name - ignored if null
/emptyBuiltinCiphers
whose Enum.name()
matches (case insensitive) the
provided argument - null
if no matchpublic static BuiltinCiphers fromFactory(NamedFactory<Cipher> factory)
factory
- The NamedFactory
for the cipher - ignored if null
BuiltinCiphers
whose factory name matches (case insensitive) the
cipher factory namefromFactoryName(String)
public static BuiltinCiphers fromFactoryName(String name)
name
- The factory name - ignored if null
/emptyBuiltinCiphers
whose factory name matches (case insensitive) the
provided name - null
if no matchpublic static BuiltinCiphers.ParseResult parseCiphersList(String ciphers)
ciphers
- A comma-separated list of ciphers' names - ignored if null
/emptyBuiltinCiphers.ParseResult
containing the successfully parsed factories and the unknown ones.
Note: it is up to caller to ensure that the lists do not contain duplicatespublic static BuiltinCiphers.ParseResult parseCiphersList(String... ciphers)
public static BuiltinCiphers.ParseResult parseCiphersList(Collection<String> ciphers)
public static CipherFactory resolveFactory(String name)
name
- The factory namenull
if it is neither a built-in one or a registered extensionCopyright © 2008–2024 The Apache Software Foundation. All rights reserved.