Loading…

Kryptel/Java

Kryptel API Commons (package com.kryptel)

This package contains a collection of commonly used constants, interfaces, and utility classes.

Constants

There are four classes defining constants (and only constants).

Capabilites

Contains a set of CAP_* constants, which specify a set of allowed features. The typical usage for these constants is limiting a component functionality to the licensed set. If you don't need to limit functionality, just call the component loader without arguments when creating a component. By default the loader uses the CAP_DEFAULT_CAPABILITIES value, which allows all possible features.

See also: Loader class, IComponentCapabilities interface.

Constants

Contains commonly used constants, most notably TYPE_*, which define the type of a given component. All those constants are self-explanatory except TYPE_HIDDEN_COMPONENT, which deserves a few more words.

TYPE_HIDDEN_COMPONENT specifies a component, which a user is not allowed to select. An example is NullCipher, which imitates a cipher but performs no encryption at all. Marking this component as hidden limits its use for debugging purpose only.

Another example is DES cipher. We need to include it for compatibility with old versions, but it should not be selected for creating new files.

Note also that programmatically a hidden component can be created and used without any limitation. TYPE_HIDDEN_COMPONENT just declares that the component is not user-selectable. If user preferences includes some component GUIDs, make sure that they don't refer to hidden components (it would probably be easy for an attacker to edit user preferences data).

See also: IKryptelComponent interface.

Guids

This class defines two sets of very important constants: component IDs and interface IDs. Every component in the library is identified by a unique 128-bit UUID structure called component ID. Every interface exported by a component is identified by a unique 128-bit UUID structure called interface ID.

See also: Components, IKryptelComponent interface.

KeyIdent

Lists static 128-bit key IDs.

Every binary key has an associated key ID, which uniquely identifies the given key file. In addition to 'dynamic' key file IDs, there are a number of pre-defined static IDs that specify the key material used during encryption. For example, IDENT_PASSWORD means that the data was encrypted with a password.

During decryption the key material ID is compared with all the static IDs. If it does not match any, then this ID belongs to a binary key file.

See also: Key File Format.

Structures

KeyRecord

Key callback function returns the received key material in this structure.

Common Component Interfaces

Every component must implement at least IKryptelComponent and IComponentState interfaces.

IComponentCapabilities

An interface for getting/setting component's compatibility mask

IComponentState

This interface is mandatory for every component and contains functions for querying state, resetting, and cloning.

IKryptelComponent

This is the base component interface, giving access to all the component's interfaces and data.

Callback Interfaces

IDataSink

The standard interface used by components to output processed data.

IKeyCallback

This interface defines key callback; high-level Kryptel components such as storage handlers obtain key material by calling client-supplied callback.

INotification

A client-implemented interface. High-level components use it for displaying short messages.

IProgressCallback

This callback displays a progress bar(s) for high-level components.

IReplaceCallback

High-level components call this callback when file name conflict occurs. The callback returns the desired action – replace, skip, etc.

Various Helper Classes

ApiHelpers

This class contains various helper functions used by library components. Those functions are unlikely to be of any interest for a developer of a client application.

Loader

Component loader is used to instantiate a component by its CID (Component ID).

Message

This class contains messages used mostly by high-level components.

Progress

A helper class for library components. Handles client-supplied IProgressCallback.

ProgressCallback

This class implements IProgressCallback and helps the user to create a progress box.