|
CXI
|
Functions | |
| KeyStore (String filename, int idxLength) throws IOException,CryptoServerException | |
| Opens the given key store database or creates it if not existing. More... | |
| KeyStore (CryptoServerConfig config, int idxLength) throws IOException,CryptoServerException | |
| Opens the given key store database or creates it if not existing. More... | |
| int | getIndexLength () throws CryptoServerException |
| Returns the index (search key) length of the database. | |
| boolean | findKey (byte[] startIndex, int mode, KeyAttributes attributes) throws CryptoServerException |
| Finds a key with the given attributes. More... | |
| Key | getKey (byte[] index) throws CryptoServerException |
| Returns the key with the given index. More... | |
| byte[] | insertKey (int flags, byte[] index, Key key) throws CryptoServerException |
| Inserts a key into the key store. More... | |
| void | deleteKey (byte[] index) throws CryptoServerException |
| Deletes the key with the given index. More... | |
| ByteArray () | |
| Creates an empty byte array. | |
| ByteArray (byte[] val) | |
| Creates a new byte array of same length and content as val. More... | |
| void | setBytes (byte[] val) |
| Sets content of byte array. More... | |
| byte[] | getBytes () |
| Returns reference to content of byte array. More... | |
| int | length () |
| Returns length of byte array. More... | |
| void | setInt (int val) |
| Sets content to 4-byte big endian representation of given integer. More... | |
| int | getInt () |
| Returns value of the integer stored as 4 bytes in big endian representation. More... | |
| void | append (byte[] val) |
| Appends byte[] data to byte array. More... | |
| void | append (ByteArray val) |
| Appends content of another ByteArray to this byte array. More... | |
| void | appendInt2 (int val) |
| Appends an integer to byte array, encoded in 2 bytes big-endian representation. More... | |
| void | appendInt4 (int val) |
| Appends an integer to byte array, encoded in 4 bytes big-endian representation. More... | |
| void | clear () |
| Clears byte array completely. | |
| KeyStore | ( | String | filename, |
| int | idxLength | ||
| ) | throws IOException,CryptoServerException |
Opens the given key store database or creates it if not existing.
| filename | filename (including path) of key store database. |
| idxLength | size of database index. The maximum size of the database index is 100. |
| KeyStore | ( | CryptoServerConfig | config, |
| int | idxLength | ||
| ) | throws IOException,CryptoServerException |
Opens the given key store database or creates it if not existing.
| config | Configuration object. The following key names will be recognized:
| ||||||||
| idxLength | size of database index. The maximum size of the database index is 100. |
| boolean findKey | ( | byte[] | startIndex, |
| int | mode, | ||
| KeyAttributes | attributes | ||
| ) | throws CryptoServerException |
Finds a key with the given attributes.
Call the function multiple times to list all keys (with the desired attributes).
| startIndex | Index to start search. |
| mode | Search mode (see Find Modes):
|
| attributes | Optional list of attributes the desired key should match. |
| Key getKey | ( | byte[] | index | ) | throws CryptoServerException |
Returns the key with the given index.
| index | Index of key to be retrieved. |
| CryptoServerException | if the key with the given index was not found. |
| byte[] insertKey | ( | int | flags, |
| byte[] | index, | ||
| Key | key | ||
| ) | throws CryptoServerException |
Inserts a key into the key store.
The key will be stored under the given index.
| flags | FLAG_OVERWRITE, if an existing key should be overwritten. |
| index | Database index for the key to be inserted. If the index value is null, the first unused index will be used. |
| key | Key to be inserted. |
| void deleteKey | ( | byte[] | index | ) | throws CryptoServerException |
Deletes the key with the given index.
| index | Index of key to be deleted. |
| CryptoServerException | if the key with the given index was not found. |
| ByteArray | ( | byte[] | val | ) |
Creates a new byte array of same length and content as val.
| val | Is copied as initial content of new byte array. |
| void setBytes | ( | byte[] | val | ) |
Sets content of byte array.
| val | Is copied as new content of byte array. |
| byte[] getBytes | ( | ) |
Returns reference to content of byte array.
| int length | ( | ) |
Returns length of byte array.
| void setInt | ( | int | val | ) |
Sets content to 4-byte big endian representation of given integer.
| val | New integer value |
| int getInt | ( | ) |
Returns value of the integer stored as 4 bytes in big endian representation.
Returns 0 if the byte array is NOT 4 bytes in length.
| void append | ( | byte[] | val | ) |
Appends byte[] data to byte array.
| val | Byte data to be appended to array. |
| void append | ( | ByteArray | val | ) |
| void appendInt2 | ( | int | val | ) |
Appends an integer to byte array, encoded in 2 bytes big-endian representation.
| val | Integer value to be appended to array. |
| void appendInt4 | ( | int | val | ) |
Appends an integer to byte array, encoded in 4 bytes big-endian representation.
| val | Integer value to be appended to array. |