de.flexiprovider.api
Class FlexiProvider

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--java.util.Hashtable
              |
              +--java.util.Properties
                    |
                    +--java.security.Provider
                          |
                          +--de.flexiprovider.api.FlexiProvider
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable
Direct Known Subclasses:
FlexiCoreProvider, FlexiECProvider, FlexiNFProvider, FlexiPQCProvider

public abstract class FlexiProvider
extends java.security.Provider

This class is the base class for all providers which are part of the FlexiProvider library. It contains registration methods which provide existence and type checking of the registered classes as well as an improved alias handling.

Author:
Martin Döring
See Also:
Serialized Form

Inner classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
protected static int ALG_PARAM_GENERATOR
          Constant for algorithm parameter generators
protected static int ALG_PARAMS
          Constant for algorithm parameters (used to encode and decode parameter specifications)
protected static int CIPHER
          Constant for ciphers
protected static int KEY_AGREEMENT
          Constant for key agreements
protected static int KEY_FACTORY
          Constant for key factories
protected static int KEY_PAIR_GENERATOR
          Constant for key pair generators
protected static int MAC
          Constant for message authentication codes (MACs)
protected static int MESSAGE_DIGEST
          Constant for message digests (hash functions)
protected static int SECRET_KEY_FACTORY
          Constant for secret key factories
protected static int SECRET_KEY_GENERATOR
          Constant for secret key generators
protected static int SECURE_RANDOM
          Constant for PRNGs
protected static int SIGNATURE
          Constant for digital signatures
 
Fields inherited from class java.security.Provider
serialVersionUID
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
protected FlexiProvider(java.lang.String name, double version, java.lang.String info)
          Construct a provider with the specified name, version number, and provider information.
 
Method Summary
protected  void add(int type, java.lang.Class algClass, java.lang.String algName)
          Register an algorithm of the given type under the given name.
protected  void add(int type, java.lang.Class algClass, java.lang.String[] algNames)
          Register an algorithm of the given type under the given names.
protected  void addReverseOID(int type, java.lang.String algName, java.lang.String oid)
          Assign an OID for the reverse mapping (OID -> algorithm name) to an algorithm.
 
Methods inherited from class java.security.Provider
clear, entrySet, getInfo, getName, getVersion, keySet, load, loadProvider, put, putAll, remove, toString, values
 
Methods inherited from class java.util.Properties
, getProperty, getProperty, list, list, propertyNames, save, setProperty, store
 
Methods inherited from class java.util.Hashtable
clone, contains, containsKey, containsValue, elements, equals, get, hashCode, isEmpty, keys, rehash, size
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CIPHER

protected static final int CIPHER
Constant for ciphers

MAC

protected static final int MAC
Constant for message authentication codes (MACs)

MESSAGE_DIGEST

protected static final int MESSAGE_DIGEST
Constant for message digests (hash functions)

SECURE_RANDOM

protected static final int SECURE_RANDOM
Constant for PRNGs

SIGNATURE

protected static final int SIGNATURE
Constant for digital signatures

ALG_PARAMS

protected static final int ALG_PARAMS
Constant for algorithm parameters (used to encode and decode parameter specifications)

ALG_PARAM_GENERATOR

protected static final int ALG_PARAM_GENERATOR
Constant for algorithm parameter generators

SECRET_KEY_GENERATOR

protected static final int SECRET_KEY_GENERATOR
Constant for secret key generators

KEY_PAIR_GENERATOR

protected static final int KEY_PAIR_GENERATOR
Constant for key pair generators

SECRET_KEY_FACTORY

protected static final int SECRET_KEY_FACTORY
Constant for secret key factories

KEY_FACTORY

protected static final int KEY_FACTORY
Constant for key factories

KEY_AGREEMENT

protected static final int KEY_AGREEMENT
Constant for key agreements
Constructor Detail

FlexiProvider

protected FlexiProvider(java.lang.String name,
                        double version,
                        java.lang.String info)
Construct a provider with the specified name, version number, and provider information.
Parameters:
name - the provider name
version - the provider version number
info - a description of the provider and its services
Method Detail

add

protected void add(int type,
                   java.lang.Class algClass,
                   java.lang.String algName)
            throws RegistrationException
Register an algorithm of the given type under the given name.
Parameters:
type - the algorithm type
algClass - the class implementing the algorithm
algName - the name for the algorithm
Throws:
RegistrationException - if the expected and actual algorithm types do not match or an algorithm is already registered under the given name.

add

protected void add(int type,
                   java.lang.Class algClass,
                   java.lang.String[] algNames)
            throws RegistrationException
Register an algorithm of the given type under the given names.
Parameters:
type - the algorithm type
algClass - the class implementing the algorithm
algNames - the names for the algorithm
Throws:
RegistrationException - if the expected and actual algorithm types do not match or an algorithm is already registered under one of the given names.

addReverseOID

protected void addReverseOID(int type,
                             java.lang.String algName,
                             java.lang.String oid)
                      throws RegistrationException
Assign an OID for the reverse mapping (OID -> algorithm name) to an algorithm. Check whether the algorithm the OID is assigned to is registered.
Parameters:
type - the algorithm type
algName - the algorithm name
oid - the OID used for reverse mapping
Throws:
RegistrationException - if the algorithm the OID is assigned to is not registered.