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) |
BuiltinFactory.Utils
Enum Constant and Description |
---|
aes128cbc |
aes128ctr |
aes192cbc |
aes192ctr |
aes256cbc |
aes256ctr |
arcfour128 |
arcfour256 |
blowfishcbc |
none |
tripledescbc |
Modifier and Type | Field and Description |
---|---|
static Set<BuiltinCiphers> |
VALUES |
BY_NAME_COMPARATOR, NAME_EXTRACTOR
FALSE, TRUE
public static final BuiltinCiphers none
public static final BuiltinCiphers aes128cbc
public static final BuiltinCiphers aes128ctr
public static final BuiltinCiphers aes192cbc
public static final BuiltinCiphers aes192ctr
public static final BuiltinCiphers aes256cbc
public static final BuiltinCiphers aes256ctr
public static final BuiltinCiphers arcfour128
public static final BuiltinCiphers arcfour256
public static final BuiltinCiphers blowfishcbc
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()
public int getIVSize()
getIVSize
in interface CipherInformation
public int getBlockSize()
getBlockSize
in interface CipherInformation
public String getAlgorithm()
getAlgorithm
in interface CipherInformation
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 SortedSet<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–2016 The Apache Software Foundation. All rights reserved.