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.
|
none |
tripledescbc
Deprecated.
|
| Modifier and Type | Field and Description |
|---|---|
static Set<BuiltinCiphers> |
VALUES |
BY_NAME_COMPARATOR, NAME_EXTRACTORFALSE, TRUEclone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfsetUpFactoriescreate, setUpBuiltinFactories, setUpTransformedFactoriesfindByName, findFirstMatchByName, getNameList, getNames, ofName, removeByName, safeCompareByNameall, any, ofpublic 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
@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 NamedResourcepublic final String toString()
toString in class Enum<BuiltinCiphers>public boolean isSupported()
isSupported in interface OptionalFeaturetrue if the current JVM configuration supports this cipher - e.g., AES-256 requires the
Java Cryptography Extension (JCE)public int getKeySize()
getKeySize in interface KeySizeIndicatorpublic int getIVSize()
getIVSize in interface CipherInformationpublic int getAuthenticationTagSize()
getAuthenticationTagSize in interface CipherInformationpublic int getKdfSize()
getKdfSize in interface CipherInformationpublic int getCipherBlockSize()
getCipherBlockSize in interface CipherInformationpublic String getAlgorithm()
getAlgorithm in interface AlgorithmNameProviderpublic String getTransformation()
getTransformation in interface CipherInformationpublic 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 nullBuiltinCiphers 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 © 2018–2021 The Apache Software Foundation. All rights reserved.