public enum BuiltinMacs extends java.lang.Enum<BuiltinMacs> implements MacFactory
| Modifier and Type | Class and Description |
|---|---|
static class |
BuiltinMacs.Constants |
static class |
BuiltinMacs.ParseResult |
| Enum Constant and Description |
|---|
hmacmd5 |
hmacmd596 |
hmacsha1 |
hmacsha196 |
hmacsha256
See RFC 6668
|
hmacsha512
See RFC 6668
|
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
algorithm |
private int |
bsize |
private int |
defbsize |
private static java.util.Map<java.lang.String,MacFactory> |
EXTENSIONS |
private java.lang.String |
factoryName |
static java.util.Set<BuiltinMacs> |
VALUES |
BY_NAME_COMPARATOR, NAME_EXTRACTORFALSE, TRUE| Modifier and Type | Method and Description |
|---|---|
Mac |
create() |
static BuiltinMacs |
fromFactory(NamedFactory<Mac> factory) |
static BuiltinMacs |
fromFactoryName(java.lang.String name) |
static BuiltinMacs |
fromString(java.lang.String s) |
java.lang.String |
getAlgorithm() |
int |
getBlockSize() |
int |
getDefaultBlockSize() |
java.lang.String |
getName() |
static java.util.NavigableSet<MacFactory> |
getRegisteredExtensions() |
boolean |
isSupported() |
static BuiltinMacs.ParseResult |
parseMacsList(java.util.Collection<java.lang.String> macs) |
static BuiltinMacs.ParseResult |
parseMacsList(java.lang.String... macs) |
static BuiltinMacs.ParseResult |
parseMacsList(java.lang.String macs) |
static void |
registerExtension(MacFactory extension)
Registered a
NamedFactory to be available besides the built-in
ones when parsing configuration |
static MacFactory |
resolveFactory(java.lang.String name) |
java.lang.String |
toString() |
static MacFactory |
unregisterExtension(java.lang.String name)
Unregisters specified extension
|
static BuiltinMacs |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static BuiltinMacs[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfsetUpFactoriescreate, setUpBuiltinFactories, setUpTransformedFactoriesfindByName, getNameList, getNames, ofName, removeByNameall, any, ofpublic static final BuiltinMacs hmacmd5
public static final BuiltinMacs hmacmd596
public static final BuiltinMacs hmacsha1
public static final BuiltinMacs hmacsha196
public static final BuiltinMacs hmacsha256
public static final BuiltinMacs hmacsha512
public static final java.util.Set<BuiltinMacs> VALUES
private static final java.util.Map<java.lang.String,MacFactory> EXTENSIONS
private final java.lang.String factoryName
private final java.lang.String algorithm
private final int defbsize
private final int bsize
public static BuiltinMacs[] values()
for (BuiltinMacs c : BuiltinMacs.values()) System.out.println(c);
public static BuiltinMacs valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic final java.lang.String getName()
getName in interface NamedResourcepublic final java.lang.String getAlgorithm()
getAlgorithm in interface AlgorithmNameProviderpublic final int getBlockSize()
getBlockSize in interface MacInformationpublic final int getDefaultBlockSize()
getDefaultBlockSize in interface MacInformationpublic final boolean isSupported()
isSupported in interface OptionalFeaturepublic final java.lang.String toString()
toString in class java.lang.Enum<BuiltinMacs>public static void registerExtension(MacFactory extension)
NamedFactory to be available besides the built-in
ones when parsing configurationextension - The factory to registerjava.lang.IllegalArgumentException - if factory instance is null,
or overrides a built-in one or overrides another registered factory
with the same name (case insensitive).public static java.util.NavigableSet<MacFactory> getRegisteredExtensions()
NavigableSet of the currently registered extensions, sorted
according to the factory name (case insensitive)public static MacFactory unregisterExtension(java.lang.String name)
name - The factory name - ignored if null/emptynull if not foundpublic static BuiltinMacs fromString(java.lang.String s)
s - The Enum's name - ignored if null/emptyBuiltinMacs whose Enum.name() matches
(case insensitive) the provided argument - null if no matchpublic static BuiltinMacs fromFactory(NamedFactory<Mac> factory)
factory - The NamedFactory for the MAC - ignored if nullBuiltinMacs whose factory name matches
(case insensitive) the digest factory namefromFactoryName(String)public static BuiltinMacs fromFactoryName(java.lang.String name)
name - The factory name - ignored if null/emptyBuiltinMacs whose factory name matches
(case insensitive) the provided name - null if no matchpublic static BuiltinMacs.ParseResult parseMacsList(java.lang.String macs)
macs - A comma-separated list of MACs' names - ignored
if null/emptyBuiltinMacs.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 BuiltinMacs.ParseResult parseMacsList(java.lang.String... macs)
public static BuiltinMacs.ParseResult parseMacsList(java.util.Collection<java.lang.String> macs)
public static MacFactory resolveFactory(java.lang.String name)
name - The factory namenull if it is neither a built-in one
or a registered extension