Loading…

Kryptel/Java

Loader class

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.