Loader class
Contents
- Introduction to the Library
- Basic support package (com.kryptel.bslx)
- Kryptel API Commons package (com.kryptel)
- ApiHelpers class
- Constants class
- IComponentCapabilities interface
- IComponentState interface
- ICompressionLevelCallback interface
- IDataSink interface
- IKryptelComponent interface
- INotification interface
- IProgressCallback interface
- IReplaceCallback interface
- Loader class
- Message class
- Progress class
- ProgressCallback class
- Cipher package (com.kryptel.cipher)
- Compressor package (com.kryptel.compressor)
- Exceptions package (com.kryptel.exceptions)
- Hash function package (com.kryptel.hash_function)
- MAC function package (com.kryptel.mac)
- Key-related functions (com.kryptel.key)
- Silver Key engine (com.kryptel.silver_key)
- Kryptel encrypted storage (com.kryptel.storage)
Declaration
package com.kryptel; public class Loader { public static IKryptelComponent CreateComponent(UUID cid) throws Exception public static IKryptelComponent CreateComponent(UUID cid, long capabilities) throws Exception public static UUID[] GetComponentList(long mask) }
Description
The component loader class is used for component creation. Although any component may be created directly with the standard new operator, in almost all real-life scenarios we know only the component's CID (Component ID, see Guids class).
CreateComponent
public static IKryptelComponent CreateComponent(UUID cid) throws Exception public static IKryptelComponent CreateComponent(UUID cid, long capabilities) throws Exception
Creates a component by its Component ID (see Guids class) and returns its base IKryptelComponent interface. If there is no component with such CID, the function returns null.
The second form allows to limit component capabilities (see Capabilites class and IComponentCapabilities interface. The first form just calls the second one with CAP_DEFAULT_CAPABILITIES mask (everything allowed).
GetComponentList
public static UUID[] GetComponentList(long mask)
Returns a list of components, which satisfy the specified type mask. The mask bits define the widest set, i.e. if you specify TYPE_BLOCK_CIPHER | TYPE_HIDDEN_COMPONENT, this function will return all ciphers and all hidden components, not just hidden ciphers as you might expect.
Type constants are defined in Constants class.