|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.flexiprovider.api.Registry
This class is responsible for the registration and instantiation of all cryptographic algorithms of the FlexiProvider. It provides methods for adding registrations of algorithms and methods for instantiating registered algorithms.
| Field Summary | |
static int |
ALG_PARAM_GENERATOR
Constant for algorithm parameter generators |
static int |
ALG_PARAM_SPEC
Constant for algorithm parameter specifications |
static int |
ALG_PARAMS
Constant for algorithm parameters (used to encode and decode parameter specifications) |
static int |
ASYMMETRIC_BLOCK_CIPHER
Constant for asymmetric block ciphers |
static int |
ASYMMETRIC_HYBRID_CIPHER
Constant for asymmetric hybrid ciphers |
static int |
BLOCK_CIPHER
Constant for symmetric block ciphers |
static int |
CIPHER
Constant for generic ciphers |
static int |
KEY_AGREEMENT
Constant for key agreements |
static int |
KEY_DERIVATION
Constant for key derivations |
static int |
KEY_FACTORY
Constant for key factories |
static int |
KEY_PAIR_GENERATOR
Constant for key pair generators |
static int |
MAC
Constant for message authentication codes (MACs) |
static int |
MESSAGE_DIGEST
Constant for message digests (hash functions) |
static int |
MODE
Constant for modes of operation |
static int |
PADDING_SCHEME
Constant for padding schemes |
static int |
SECRET_KEY_FACTORY
Constant for secret key factories |
static int |
SECRET_KEY_GENERATOR
Constant for secret key generators |
static int |
SECURE_RANDOM
Constant for PRNGs |
static int |
SIGNATURE
Constant for digital signatures |
| Constructor Summary | |
Registry()
|
|
| Method Summary | |
(package private) static void |
|
static void |
add(int type,
java.lang.Class algClass,
java.lang.String algName)
Register an algorithm of the given type under the given name. |
static void |
add(int type,
java.lang.Class algClass,
java.lang.String[] algNames)
Register an algorithm of the given type under the given names. |
static void |
addStandardAlgParams(java.lang.String[] algNames,
java.lang.String[] paramNames)
Register a list of standardized algorithm parameters for the given list of algorithms. |
static void |
addStandardAlgParams(java.lang.String algName,
java.lang.String[] paramNames)
Register a list of (names of) standardized algorithm parameters for the given algorithm. |
static java.util.Enumeration |
getAlgorithms(int type)
Return all algorithms of the given type. |
static AlgorithmParameterGenerator |
getAlgParamGenerator(java.lang.String algName)
Return an instance of the specified algorithm parameter generator. |
static AlgorithmParameters |
getAlgParams(java.lang.String algName)
Return an instance of the specified algorithm parameters. |
static AlgorithmParameterSpec |
getAlgParamSpec(java.lang.String paramName)
Return an instance of the algorithm parameter specification class corresponding to the given algorithm name. |
static java.lang.Class |
getAlgParamSpecClass(java.lang.String algName)
Return the algorithm parameter specification class corresponding to the given algorithm name. |
static AsymmetricBlockCipher |
getAsymmetricBlockCipher(java.lang.String algName)
Return an instance of the specified asymmetric block cipher. |
static AsymmetricHybridCipher |
getAsymmetricHybridCipher(java.lang.String algName)
Return an instance of the specified asymmetric hybrid cipher. |
static BlockCipher |
getBlockCipher(java.lang.String transformation)
Try to find an algorithm with the specified name inside the corresponding hashtable and return an instance of the algorithm. |
static Cipher |
getCipher(java.lang.String algName)
Return an instance of the specified cipher. |
static KeyAgreement |
getKeyAgreement(java.lang.String algName)
Return an instance of the specified key agreement scheme. |
static KeyDerivation |
getKeyDerivation(java.lang.String algName)
Return an instance of the specified key derivation function. |
static KeyFactory |
getKeyFactory(java.lang.String algName)
Return an instance of the specified key factory. |
static KeyPairGenerator |
getKeyPairGenerator(java.lang.String algName)
Return an instance of the specified key pair generator. |
static Mac |
getMAC(java.lang.String algName)
Return an instance of the specified message authentication code (MAC). |
static MessageDigest |
getMessageDigest(java.lang.String algName)
Return an instance of the specified message digest. |
protected static Mode |
getMode()
|
protected static Mode |
getMode(java.lang.String modeName)
Return an instance of the specified mode. |
static java.util.Vector |
getNames(int type,
java.lang.String name)
Return all names of the given algorithm and type. |
protected static PaddingScheme |
getPaddingScheme()
|
protected static PaddingScheme |
getPaddingScheme(java.lang.String paddingName)
Return an instance of the specified padding scheme. |
static SecretKeyFactory |
getSecretKeyFactory(java.lang.String algName)
Return an instance of the specified secret key factory. |
static SecretKeyGenerator |
getSecretKeyGenerator(java.lang.String algName)
Return an instance of the specified secret key generator. |
static SecureRandom |
getSecureRandom()
|
static SecureRandom |
getSecureRandom(java.lang.String algName)
Return an instance of the specified source of randomness. |
static Signature |
getSignature(java.lang.String algName)
Return an instance of the specified signature. |
static java.util.Vector |
getStandardAlgParams(java.lang.String algName)
Return the set of standardized algorithm parameters registered for the given algorithm, or null if no parameters are registered for the given algorithm. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int ASYMMETRIC_BLOCK_CIPHER
public static final int ASYMMETRIC_HYBRID_CIPHER
public static final int BLOCK_CIPHER
public static final int MODE
public static final int PADDING_SCHEME
public static final int CIPHER
public static final int MAC
public static final int MESSAGE_DIGEST
public static final int SECURE_RANDOM
public static final int SIGNATURE
public static final int ALG_PARAM_SPEC
public static final int ALG_PARAMS
public static final int ALG_PARAM_GENERATOR
public static final int SECRET_KEY_GENERATOR
public static final int KEY_PAIR_GENERATOR
public static final int SECRET_KEY_FACTORY
public static final int KEY_FACTORY
public static final int KEY_DERIVATION
public static final int KEY_AGREEMENT
| Constructor Detail |
public Registry()
| Method Detail |
static void()
public static final void add(int type,
java.lang.Class algClass,
java.lang.String algName)
type - the algorithm typealgClass - the class implementing the algorithmalgName - the name for the algorithmRegistrationException - if the expected and actual algorithm types do not match or an
algorithm is already registered under the given name.
public static final void add(int type,
java.lang.Class algClass,
java.lang.String[] algNames)
type - the algorithm typealgClass - the class implementing the algorithmalgNames - the names for the algorithmRegistrationException - if the expected and actual algorithm types do not match or an
algorithm is already registered under one of the given names.public static final java.util.Enumeration getAlgorithms(int type)
type - the algorithm typeEnumeration of all algorithms contained in the hash
table
public static final java.util.Vector getNames(int type,
java.lang.String name)
type - the algorithm typename - (one of the) names of the algorithmVector containing all names of the algorithm
public static final AsymmetricBlockCipher getAsymmetricBlockCipher(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the asymmetric block cipherAsymmetricBlockCipher object implementing the
chosen algorithmNoSuchAlgorithmException - if the asymmetric block cipher cannot be found.
public static final AsymmetricHybridCipher getAsymmetricHybridCipher(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the asymmetric hybrid cipherAsymmetricHybridCipher object implementing the
chosen algorithmNoSuchAlgorithmException - if the asymmetric hybrid cipher cannot be found.
public static final BlockCipher getBlockCipher(java.lang.String transformation)
throws NoSuchAlgorithmException,
NoSuchPaddingException
transformation - the transformation (either of the form 'algorithm' or
'algorithm/mode/padding')NoSuchAlgorithmException - if the block cipher or mode cannot be found.NoSuchPaddingException - if the padding scheme cannot be found.protected static final Mode getMode()
protected static final Mode getMode(java.lang.String modeName)
throws NoSuchModeException
modeName - the name of the modeMode object implementing the chosen algorithmNoSuchModeException - if the mode cannot be found.protected static final PaddingScheme getPaddingScheme()
protected static final PaddingScheme getPaddingScheme(java.lang.String paddingName)
throws NoSuchPaddingException
paddingName - the name of the padding schemePaddingScheme object implementing the chosen
algorithmNoSuchPaddingException - if the padding scheme cannot be found.
public static final Cipher getCipher(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the cipherCipher object implementing the chosen algorithmNoSuchAlgorithmException - if the cipher cannot be found.
public static final Mac getMAC(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the MACMac object implementing the chosen algorithmNoSuchAlgorithmException - if the MAC cannot be found.
public static final MessageDigest getMessageDigest(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the message digestMessageDigest object implementing the chosen
algorithmNoSuchAlgorithmException - if the message digest cannot be found.
public static final SecureRandom getSecureRandom(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the source of randomnessSecureRandom object implementing the chosen
algorithmNoSuchAlgorithmException - if the source of randomness cannot be found.public static final SecureRandom getSecureRandom()
java.lang.RuntimeException - if the default secure random cannot be instantiated.
public static final Signature getSignature(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the signatureSignature object implementing the chosen algorithmNoSuchAlgorithmException - if the signature cannot be found.
public static final java.lang.Class getAlgParamSpecClass(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the algorithm nameNoSuchAlgorithmException - if the parameters class cannot be found.
public static final AlgorithmParameterSpec getAlgParamSpec(java.lang.String paramName)
throws InvalidAlgorithmParameterException
paramName - the name of the standard algorithm parametersInvalidAlgorithmParameterException - if the parameters cannot be found.
public static final void addStandardAlgParams(java.lang.String algName,
java.lang.String[] paramNames)
add(int, Class, String) or
add(int, Class, String[]) method with the
ALG_PARAM_SPEC type.algName - the name of the algorithmparamNames - the names of the standardized algorithm parameters suitable
for the specified algorithm
public static final void addStandardAlgParams(java.lang.String[] algNames,
java.lang.String[] paramNames)
add(int, Class, String) or
add(int, Class, String[]) method with the
ALG_PARAM_SPEC type.algNames - the names of the algorithmsparamNames - the names of the standardized algorithm parameters suitable
for the specified algorithmpublic static final java.util.Vector getStandardAlgParams(java.lang.String algName)
algName - the algorithm nameVector of standardized algorithms parameters for the
specified algorithm, or null if no parameters are
registered for the algorithm
public static final AlgorithmParameters getAlgParams(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the algorithm parametersAlgorithmParameters object implementing the chosen
algorithmNoSuchAlgorithmException - if the algorithm parameters cannot be found.
public static final AlgorithmParameterGenerator getAlgParamGenerator(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the algorithm parameter generatorAlgorithmParameterGenerator object implementing the
chosen algorithmNoSuchAlgorithmException - if the algorithm parameter generator cannot be found.
public static final SecretKeyGenerator getSecretKeyGenerator(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the secret key generatorSecretKeyGenerator object implementing the chosen
algorithmNoSuchAlgorithmException - if the secret key generator cannot be found.
public static final KeyPairGenerator getKeyPairGenerator(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the key pair generatorKeyPairGenerator object implementing the chosen
algorithmNoSuchAlgorithmException - if the key pair generator cannot be found.
public static final SecretKeyFactory getSecretKeyFactory(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the secret key factorySecretKeyFactory object implementing the chosen
algorithmNoSuchAlgorithmException - if the secret key factory cannot be found.
public static final KeyFactory getKeyFactory(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the key factoryKeyFactory object implementing the chosen algorithmNoSuchAlgorithmException - if the key factory cannot be found.
public static final KeyDerivation getKeyDerivation(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the key derivation functionKeyDerivation object implementing the chosen
algorithmNoSuchAlgorithmException - if the key derivation cannot be found.
public static final KeyAgreement getKeyAgreement(java.lang.String algName)
throws NoSuchAlgorithmException
algName - the name of the key agreement schemeKeyAgreement object implementing the chosen
algorithmNoSuchAlgorithmException - if the key agreement scheme cannot be found.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||