Cbios API Reference
Cbios API Reference
Executive summary
This document describes the most important part of the CRYPTO-BOX API for developers: CBIOS API. It
provides functions for identification and access to the internal memory and encryption functions of a
connected CRYPTO-BOX. To realize an effective protection scheme, CBIOS is always required while all
other SmarxOS APIs (DO, RFP, DP) provide extended functionality on top of it.
CBIOS version 1.5 and up covers the following types of USB hardware:
• CRYPTO-BOX® SC (CBU SC);
• CRYPTO-BOX® XS/Versa (CBU XS/Versa).
The CRYPTO-BOX SC is fully backward compatible to the CRYPTO-BOX XS and Versa models.
If you are looking for C#.NET support, please refer to our separate "CBIOS4NET Developer's Guide"
(available at www.marx.com -> Support -> White Papers).
Software and information piracy costs billions of dollars in annual losses to software vendors, distributors
and content providers worldwide. The internets role in software and data distribution is growing rapidly
and increases the importance of the situation dramatically. Hardware based protection can be used for
creating robust and reliable secure demo versions of applications in a straightforward manner. While
benefiting from strong and effective application protection provided by a hardware based approach you
can create flexible and secure demo versions with ease. The CRYPTO-BOX makes it happen!
1.1. Overview
This chapter describes the most important part of the CRYPTO-BOX API for developers:
CBIOS API. It provides functions for CRYPTO-BOX identification and access to the internal
memory and encryption functions of a connected CRYPTO-BOX and is mainly targeted to
C/C++, Delphi and Visual Basic developers.
This document contains the CBIOS API reference only. If you need more information first
on how to start implementing the CRYPTO-BOX with API:
• Our White Paper “Implementation with API” provides a general introduction and
overview about all available APIs for the CRYPTO-BOX, including the new object
oriented Smarx API.
• Read chapter 14 in the Smarx Compendium first before working with this document – it
will help you to understand the CBIOS call sequence.
• For an introduction to network usage, please refer to Smarx Compendium, chapter 12.
• CRYPTO-BOX SC specific API functions (extended hardware based AES and RSA
functions) are described in the Smarx Compendium, chapter 12.9.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 5
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 6
This function initializes CBIOS API for this application. It is not necessary to call this function
explicitly, it will be called in background if the first CBIOS call is CBIOS_ScanBoxes(). But you
always have to make sure to call corresponding CBIOS_Finish before closing the application.
If you need to use CBIOS from within a DLL it is strongly recommended to create two special
functions in your DLL, like: Begin_CBIOS_Support() and End_CBIOS_Support() calling
CBIOS_Startup() and CBIOS_Finish() correspondingly. The first one must be called before
any other CBIOS related DLL function call, while the second must be the last one.
If for some reason this is not feasible, then the following "special" DLL implementation of
CBIOS system brackets has to be used:
//***********************************
BOOL APIENTRY DllMain (
HANDLE hModule
, DWORD ul_reason_for_call
, LPVOID lpReserved )
{
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
// Important!!! Pass hModule into CBIOS_StartupDLLEx.
// If none then this call will be equivalent to CBIOS_Startup ().
// i.e. memory leaks.
CBIOS_StartupDLLEx (hModule);
break;
case DLL_PROCESS_DETACH:
CBIOS_FinishDLL();
break;
}
return TRUE;
}
//**********************************
It is not recommended to do it from within DLLMain, because thread and window creation is
not supported at that point. That’s why special non-standard functions are provided,
bypassing standard Windows limitations – CBIOS_StartupDLLEx() / CBIOS_FinishDLL() used
in the above sample of DLLMain entry point.
Return:
CBIOS_ERR_NOT_INITIALIZED CBIOS initialization error. Further CBIOS work is not
possible
CBIOS_ERR_INIT_IN_PROGRESS CBIOS initialization process is not yet complete.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 7
Parameters: None
Return:
Additionally to CBUSB standard return codes:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode
Scans USB local ports and determines attached CRYPTO-BOX (if any).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 8
Parameters: None
Return:
Number of attached CRYPTO-BOXes. In case of CBIOS Extended Mode – returns zero.
Returns “-1” in case of CBIOS initialization error.
Although it is sufficient to call this function only once (for one application), we recommend
you to register a callback notification handling function
CBIOS_RegisterNotificationCallback() or CBIOS_RegisterNotificationMessage() to
keep track of hardware configuration changes (i.e. after attaching/detaching a
CRYPTO-BOX). Alternatively, CBIOS_ScanBoxes() needs to be called each time the
application wants to refresh information about the hardware configuration.
Parameters:
INT32 iBoxIndex IN: CRYPTO-BOX # from 1 to <Box Quantity> value,
Returned by the preceding CBIOS_ScanBoxes() call
CBIOS_BOX_INFO* pBoxInfo IN/OUT: Pointer to the structure which contains
CRYPTO-BOX information.
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox)
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 9
Or standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see cbios.h)
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 10
Parameters:
INT32 iBoxIndex IN: CRYPTO-BOX # from 1 to <Box Quantity> value,
Returned by the preceding CBIOS_ScanBoxes() call
CBIOS_BOX_INFO_ADV* pBoxInfo OUT: Pointer to the structure which will contain
CRYPTO-BOX information. dwStructSize must be set
to sizeof(CBIOS_BOX_INFO_ADV)
Return:
CBIOS_ERR_WRONG_PARAM dwStructSize value is wrong
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox)
CBIOS_ERR_BOX_NOT_FOUND CRYPTO-BOX not found (invalid iBoxIndex)
Or standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see cbios.h)
Since July 2005 CRYPTO-BOX USB hardware distributed to customers contain hard coded
Developer ID - a unique value for every MARX customer (all CRYPTO-BOX modules of this
customer have the same value of DeveloperID).
The returned value (DWORD) includes: unique Developer ID for every MARX customer all over
the world.
For CRYPTO-BOX USB formatted before July 2005 zero value will be returned as Developer
ID.
Parameters:
INT32 iBoxIndex IN: CRYPTO-BOX # from 1 to <Box Quantity> value,
returned by the preceding CBIOS_ScanBoxes() call
DWORD* pdwDeveloperID OUT: Points to the DWORD, where CRYPTO-BOX
DeveloperID is placed
Return:
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 12
Or standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see cbios.h)
Parameters:
INT32 iBoxIndex IN: CRYPTO-BOX # from 1 to <Box Quantity> value,
returned by the preceding CBIOS_ScanBoxes() call
BYTE bSerNum[16] OUT: Points to the structure, where the CRYPTO-BOX
Serial Number will be stored
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox)
CBIOS_ERR_BOX_NOT_FOUND CRYPTO-BOX not found (invalid iBoxIndex)
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened (CBIOS_Open).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 13
Or standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see cbios.h)
Parameters:
INT32 iBoxIndex IN: CRYPTO-BOX # starting from 1 to <Box Quantity>
value, returned by the preceding CBIOS_ScanBoxes() call
INT32 iAppIndex IN: Application number starting from 1 to the <wApp>
value, returned by the previous CBIOS_GetBoxInfoI() call
CBIOS_APP_INFO* pAppInfo OUT: Points to the structure, where application
information will be placed
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox)
CBIOS_ERR_BOX_NOT_FOUND CRYPTO-BOX not found (invalid iBoxIndex)
CBIOS_ERR_OUT_OF_RANGE Invalid iAppIndex
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 14
Returns the last error code for the currently opened CRYPTO-BOX.
Parameters: None
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Parameters:
INT32 iBoxIndex IN: CRYPTO-BOX # starting from 1 to <Box Quantity>
value, returned by the preceding CBIOS_ScanBoxes()
call
WORD wAppID IN: Application Identifier. The corresponding partition
must exist in this CRYPTO-BOX. It is possible to specify
“0”. This permits working with the CRYPTO-BOX (for
example, to change BoxLabel, etc.) , but there is no
access to its memory.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 15
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function
calls are not allowed in this mode.
CBIOS_ERR_BOX_NOT_FOUND CRYPTO-BOX not found (invalid iBoxIndex)
CBIOS_ERR_BOX_ALREADY_OPENED This thread has already opened a
CRYPTO-BOX. To open this one it is necessary
to close currently opened CRYPTO-BOX
(CBIOS_Close).
CBIOS_ERR_APP_NOT_FOUND This CRYPTO-BOX (iBoxIndex) contains no
partition with the specified application
(wAppID)
CBIOS_ERR_TOO_MANY_BOXES_OPEN Too many CRYPTO-BOXes are opened (more
than 32 simultaneously on this computer)
After opening the CRYPTO-BOX, Smarx OS records the fact that this CRYPTO-BOX is open
for the current thread and specified application (wAppID). That means that all further
CBIOS calls from the thread will work only with this application partition.
Parameters:
DWORD dwBoxName IN: dwBoxName
WORD wAppID IN: Application Identifier. The corresponding partition
must exist in this CRYPTO-BOX. It is possible to specify
“0”. This permits working with the CRYPTO-BOX (for
example, to change BoxLabel, etc.) , but there is no
access to its memory.
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function
calls are not allowed in this mode
CBIOS_ERR_BOX_NOT_FOUND CRYPTO-BOX not found (there is no
CRYPTO-BOX with specified dwBoxName)
CBIOS_ERR_BOX_ALREADY_OPENED This thread has already opened a
CRYPTO-BOX. To open this one it is necessary
to close currently opened CRYPTO-BOX
(CBIOS_Close).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 16
After opening the CRYPTO-BOX, Smarx OS records the fact that this CRYPTO-BOX is open
for the current thread and specified application (wAppID). That means that all further
CBIOS calls from the thread will work only with this application partition.
If more than one CRYPTO-BOX with the same BoxLabel is attached, then the CRYPTO-BOX
with the lowest index will be open (the index is defined by operating system and depends, for
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 17
After opening the CRYPTO-BOX, Smarx OS records the fact that this CRYPTO-BOX is open
for the current thread and specified application (wAppID). That means that all further
CBIOS calls from the thread will work only with this application partition.
Parameters:
WORD wAppID IN: Application Identifier. The corresponding partition
must exist in this CRYPTO-BOX. It is possible to specify
“0”. This permits working with the CRYPTO-BOX (for
example, to change BoxLabel, using encryption
functions, etc.), but there is no access to its memory.
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function
calls are not allowed in this mode.
CBIOS_ERR_BOX_NOT_FOUND CRYPTO-BOX not found (there is no
CRYPTO-BOX with specified wAppID).
CBIOS_ERR_BOX_ALREADY_OPENED This thread has already opened a
CRYPTO-BOX. To open this one, the currently
opened CRYPTO-BOX has to be closed first
(CBIOS_Close).
CBIOS_ERR_TOO_MANY_BOXES_OPEN Too many CRYPTO-BOXes are opened (more
than 32 simultaneously on this computer).
If more than one attached CRYPTO-BOX has a partition for the specified application, then the
one with the lower index number will be opened (the index is defined by operating system and
depends, for example, on the sequence in which the CRYPTO-BOXes were attached).
After opening the CRYPTO-BOX, Smarx OS records the fact that this CRYPTO-BOX is open
for the current thread and specified application (wAppID). That means that all further
CBIOS calls from the thread will work only with this application partition.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 18
Parameters: None
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened.
Locks the CRYPTO-BOX (opened in the current thread). Other threads/processes will wait in
the queue with 20 seconds (timeout) and will return CBIOS_ERR_LOCK_TIMEOUT if the
CRYPTO-BOX is not unlocked before timeout is reached.
To unlock CRYPTO-BOX call CBIOS_UnlockBox.
Parameters: None
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds.
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened
Locks the CRYPTO-BOX (opened in the current thread). Other threads/processes will wait in
the queue with dwTimeoutMsec milliseconds (timeout) and will return
CBIOS_ERR_LOCK_TIMEOUT if the CRYPTO-BOX is not unlocked before timeout is reached.
To unlock CRYPTO-BOX call CBIOS_UnlockBox.
Parameters:
DWORD dwTimeoutMsec IN: Timeout in milliseconds
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than
dwTimeoutMsec milliseconds.
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened
Parameters: None
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 20
Parameters:
INT32 iBoxIndex IN: CRYPTO-BOX # starting from 1 to <Box Quantity>
value, returned by the preceding CBIOS_ScanBoxes()
call
Return:
TRUE – Locked, FALSE – Unlocked
CBIOS_LockLicence() call gives exclusive access to the open partition, locking it for any other
applications/threads. After this call no other application can open the partition using
CBIOS_OpenBy###(), any attempt to open it will result in CBIOS_ERR_NO_FREE_LICENCE
error code. Exclusive access mode will be canceled only after the application that uses this
partition exclusively issues CBIOS_ReleaseLicense() or closes the session using
CBIOS_Close().
CBIOS_LockLicence()/CBIOS_ReleaseLicence() can be used to prevent the launch of several
copies of a protected application trough Terminal Server (see SmarxOS Compendium,
chapter 11.2.8 for more details).
CBIOS_LockLicence() locks only the currently open partition. Other partitions of the
CRYPTO-BOX are still available for other applications/processes, the same is true for
hardware encryption functionality.
Parameters: None
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls
are not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more
than 20 seconds.
CBIOS_ERR_BOX_ALREADY_OPENED This thread has already opened a CRYPTO-BOX.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 21
license locking. From network licensing standpoint this function is less secure comparing to
the standard one. Be careful with extended network licensing and use its rules only when it is
required by your licensing approach. The extended rules are described in
CBIOS_SetRuleAppLicences function.
Parameters: None
Return:
CBIOS_ERR_OUT_OF_RANGE Invalid rule ID
Unlocks the current partition so that other applications (processes/threads) can access it.
Parameters: None
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function
calls are not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more
than 20 seconds.
CBIOS_ERR_BOX_ALREADY_OPENED This thread has already opened a CRYPTO-BOX.
Parameters: None
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 22
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened (CBIOS_Open).
This call registers the CBIOS notification handler: fNotify callback function. The function will
receive notifications on CRYPTO-BOX USB attach/detach events.
Parameters:
F_CBIOS_NOTIFY_CALLBACK* fNotify IN: Pointer to the callback function
void* pParam IN: User specific data. This value will be sent to
the fNotify callback function for every notification
call.
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_WRONG_PARAM fNotify pointer is NULL
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 23
Besides receiving notifications to the callback function it is also possible to get them as
window messages – see: CBIOS_RegisterNotificationMessage()
Parameters:
F_CBIOS_NOTIFY_CALLBACK* IN: Pointer to the callback function
fNotify
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_WRONG_PARAM fNotify pointer is NULL
This call registers window (hWnd) to receive notification messages on CRYPTO-BOX USB
attach/detach events.
Parameters:
HWND hWnd IN: Handle of the window to receive notification
messages
UNIT message IN: The message code to be sent, usually
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 24
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_WRONG_PARAM hWnd is NULL
One application may register more than one notification. It can be useful for DLLs and static
libraries.
The notification message received by the hWnd window includes the following information:
This call unregisters hWnd window from receiving CBIOS notification messages.
Parameters:
HWND hWnd IN: Pointer to the callback function
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_WRONG_PARAM fNotify pointer is NULL
Besides receiving notifications as window messages it is also possible to get them to the
callback function – see: CBIOS_RegisterNotificationCallback().
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 25
Parameters:
BYTE IN: New Volume Label
bBoxLabel[CBIOS_LABEL_LEN]
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
1.7.2. Login/Logout
In case of successful login, the CRYPTO-BOX will be automatically locked for the current
thread, until CBIOS_Logout() is called. All calls outside of this thread will be queued for 20
seconds.
Parameters:
BYTE bUPW[0x10] IN: User Password (UPW)
Return:
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 26
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
In case of successful login, the CRYPTO-BOX will be automatically locked for the current
thread, until CBIOS_Logout() is called. All calls outside of this thread will be queued for 20
seconds.
Parameters:
BYTE bAPW[0x10] IN: Admin Password(APW)
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls
are not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more
than 20 seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_ALREADY_LOGGED CRYPTO-BOX is already logged. CBIOS_Logout
has to be called first.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 27
Parameters: None
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Parameters:
DWORD dwLen IN: Length of data pool in bytes
PVOID pBuffer OUT: Random data pool pointer
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open.
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 28
If you change User and/or Administrator Password, you will be no longer able to use the
Smarx Application Framework (SxAF) GUI tool for CRYPTO-BOX formatting, since it is
using standard values from TRX file! The SmrxProg.exe command line tool can handle
modified UPW values by adding the <UPW OPERATION="USE"> tag. More details can be
found in the SmrxProg readme file.
Parameters:
BYTE bOldPass[0x10] IN: Old User or Admin Password
BYTE bNewPass[0x10] IN: New User Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open.
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 29
Parameters:
BYTE bOldPass[0x10] IN: Old Admin Password
BYTE bNewPass[0x10] IN: New Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Parameters:
BYTE bKey[0x10] IN: Pointer to Key bit data
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 30
Parameters:
BYTE bIV[0x10] IN: Pointer to Initialization Vector bit data
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Parameters:
BYTE bKey[0x10] IN: Pointer to Key bit data
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 31
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Parameters:
BYTE bIV[0x10] IN: Pointer to Initialization Vector bit data
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Encrypts/decrypts data using internal hardware algorithm with fixed key and fixed
initialization vector. The Fixed Key and its IV is hard coded and cannot be reprogrammed.
Every MARX customer has the same values for hardware Rijndael keys initially programmed
to all his CRYPTO-BOX units.
Parameters:
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 32
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Encrypts/decrypts data using internal hardware algorithm with private key and private
initialization vector (IV). The Private Key (and its IV) requires the User Password for usage and
the Admin Password for reprogramming.
Parameters:
DWORD dwLen IN: Data pool length
PVOID pBuffer IN/OUT: Pointer to data pool
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_BOX_NOT_LOGGED There is currently no login to CRYPTO-BOX at user
(CBIOS_UPWLogin) or administrator
(CBIOS_APWLogin) level.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 33
Encrypts/decrypts data using internal hardware algorithm with session key and session
initialization vector (IV). The Session Key (and its IV) can be used and reprogrammed by any
application without password submission.
Parameters:
DWORD dwLen IN: Data pool length
PVOID pBuffer IN/OUT: Pointer to data pool
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
[in] Index of AES cell in CBU SC RAM5 zone for this key
dwKeyIndex
(starting from 0)
pAESKey [in] Pointer to AES key value in computer memory
[in] Pointer to a structure with AES key information (optional)
pAESKeyInfo
Description: This function writes CBU SC AES key value (pAESKey) to one of AES key holding
cells (dwKeyIndex) in dedicated CBU SC memory zone (RAM5).
The pAESKeyInfo structure can optionally set access rights for this key, including: its usage
for encryption; obtaining access rights info and/or changing the key value/access rights.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 34
See section 1.7.5.3 for more details on how to define access rights and limitations using
CBIOS_AES_KEY_INFO structure.
Example: the Test_AES () function of CBU2_Sample.c (MSVS 2005 or 2008 static sample
included to the Smarx OS PPK) illustrates this call usage.
Description: This function changes access rights and limitations for CBU SC AES cell
(dwKeyIndex) to values defined in the pAESKeyInfo structure.
It can change access rights for this key on: its usage for encryption, obtaining access rights
info and/or changing the key value/access rights. See section 1.7.5.3 for more details on how
to define access rights and limitations in CBIOS_AES_KEY_INFO structure.
Example: the Test_AES () function of CBU2_Sample.c (MSVS 2005 or 2008 static sample
included to the Smarx PPK) illustrates this call usage.
[in] Index of AES cell in CBU SC RAM5 zone storing the key
dwKeyIndex
(starting from 0)
pAESKeyInfo [in] Pointer to the structure that will receive AES key information
[return] CBIOS Error code.
Description: This function retrieves access rights and limitations data for CBU SC AES cell
(dwKeyIndex) to the pAESKeyInfo structure. See section 1.7.5.3 for more details on how to
define/interpret access rights and limitations in CBIOS_AES_KEY_INFO structure.
Example: the Test_AES (void) function of CBU2_Sample.c (MSVS 2005 or 2008 static sample
included to the Smarx PPK) illustrates this call usage.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 35
dwKeyIndex [in] Index of CBU SC AES cell storing the key (starting from 0)
[return] CBIOS Error code.
Description: This function locks the CBU SC AES cell (dwKeyIndex), so this key can not be
used for further AES encryption/decryption operations.
Description: This function performs CBU SC hardware based AES encryption using
dwKeyIndex cell in RAM5 CBU SC memory as AES key holder.
The dwMode parameter defines which mode of encryption/decryption should be used: CBC
of OFB.
The input data (byte array pInBuffer of length dwBufferLen) will be encrypted and the result
of this operation will be placed to the pOutBuffer.
The AES algorithm logic assumes that encrypted buffer size is always the same as source
buffer size. When using the CBC mode this size must be multiple of the key size (16 bytes).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 36
typedef struct {
DWORD dwStructSize;
BYTE ubKey[CBIOS_AES_KEY_LEN];
} CBIOS_AES_KEY;
CBIOS_AES_KEY_INFO
This structure defines access rights and limitations for CBU SC AES key: its usage for
encryption, obtaining access rights info and/or changing the key value/access rights.
typedef struct {
DWORD dwStructSize;
DWORD dwAccess; // low nibble: SetKey/SetKeyInfo access rights,
// high nibble: Encrypt/Decrypt and GetKeyInfo
WORD wBits;
} CBIOS_AES_KEY_INFO;
Comment: The dwAccess member of this structure defines required access rights or returns
current access rights for AES key. For any CBU SC AES key access rights can be set for:
• encryption/decryption and obtaining information on this key (key strength and current
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 37
access rights)
• changing the key value
• CBIOS_CBU2_ACCESS_NEVER – this value (if being set) can not be reset even by MARX
distributor. MARX distributor can only reprogram the whole RAM4 zone of this CBU SC
unit, so all current values of AES keys (if any) will be lost
• CBIOS_CBU2_ACCESS_ALWAYS – this value means free access (no limitations).
• CBIOS_CBU2_ACCESS_UPW – UPW login is required
• CBIOS_CBU2_ACCESS_APW – APW login is required
• CBIOS_CBU2_ACCESS_LOCK – the access will be locked, only MARX distributor can
unlock it.
Parameters:
DWORD dwAddress IN: data address in RAM1
DWORD dwLen IN: Data length in RAM1
PVOID pBuffer OUT: Pointer to data pool
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 38
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Parameters:
DWORD dwAddress IN: Data address in RAM1
DWORD dwLen IN: Data length in RAM1
PVOID pBuffer IN: Pointer to data pool
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 39
Parameters:
DWORD dwAddress IN: Data address in RAM2
DWORD dwLen IN: Data length in RAM2
PVOID pBuffer OUT: Pointer to data pool
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Parameters:
DWORD dwAddress IN: Data address in RAM2
DWORD dwLen IN: Data length in RAM2
PVOID pBuffer IN: Pointer to data pool
BYTE bPass[0x10] IN: Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 40
cbios.h).
In contrast to the User Password (UPW), the Admin Password (APW) is not cached,
therefore the APW needs to be submitted for each function call requiring it (e.g.
CBIOS_WriteRAM2).
We strongly recommend to consider RAM2 as read-only area to keep the the Admin
Password (APW) secret (never included to the protected application).
Parameters:
DWORD dwAddress IN: Data address in RAM3
DWORD dwLen IN: Data length in RAM3
PVOID pBuffer OUT: Pointer to data pool
BYTE bPass[0x10] IN: - reserved
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 41
Parameters:
DWORD dwAddress IN: Data address in RAM3
DWORD dwLen IN: Data length in RAM3
PVOID pBuffer IN: Pointer to data pool
BYTE bPass[0x10] IN: - reserved
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 42
The CRYPTO-BOX XS and Versa models provide RSA support in software (on driver level).
The CRYPTO-BOX SC provides hardware-based RSA (key never leaves the hardware). For
more details and CRYPTO-BOX SC specific API functions please refer section 1.7.7.3.
Parameters:
DWORD dwKeyMemory IN: Type of memory in which RSA-Key is stored
RAM1 = 1 / RAM2 = 2 / RAM3 = 3
DWORD dwKeyOffset IN: Key offset in RAM
PVOID pInBuffer IN: Pointer to original data
DWORD dwInBufferLen IN: Length of original data
PVOID pOutBuffer OUT: Pointer to encrypted data
DWORD * dwOutBufferLen OUT: Pointer to length of encrypted data
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 43
The CRYPTO-BOX XS and Versa models provide RSA support in software (on driver level).
The CRYPTO-BOX SC provides hardware-based RSA (key never leaves the hardware). For
more details and CRYPTO-BOX SC specific API functions please refer section 1.7.7.3.
Parameters:
DWORD dwKeyMemory IN: Type of memory in which RSA-Key is stored
RAM1 = 1 / RAM2 = 2 / RAM3 = 3
DWORD dwKeyOffset IN: Key offset in RAM
PVOID pInBuffer IN: Pointer to encrypted data
DWORD dwInBufferLen IN: Length of encrypted data
PVOID pOutBuffer OUT: Pointer to decrypted data
DWORD * dwOutBufferLen OUT: Pointer to length of decrypted data
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 44
Retrieves public RSA key stored in RAM for software RSA encryption.
Parameters:
DWORD dwKeyMemory IN: Type of memory where RSA-Key is stored:
RAM1 = 1 / RAM2 = 2 / RAM3 = 3
DWORD dwKeyOffset IN: Key offset in RAM
CBIOS_RSA_PUBLIC_KEY OUT: Pointer to public RSA key structure
*pRSAKey
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 45
Retrieves private RSA key stored in RAM for software RSA encryption.
Parameters:
DWORD dwKeyMemory IN: Type of memory where RSA-Key is stored
RAM1 = 1
RAM2 = 2
RAM3 = 3
DWORD dwKeyOffset IN: Key offset in RAM
CBIOS_RSA_PRIVATE_KEY *pRSAKey OUT: Pointer to private RSA key structure
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 46
Stores public RSA key into RAM for software RSA encryption.
Parameters:
DWORD dwKeyMemory IN: Type of memory where RSA-Key is stored
RAM1 = 1 / RAM2 = 2 / RAM3 = 3
DWORD dwKeyOffset IN: Key offset in RAM
CBIOS_RSA_PUBLIC_KEY *pRSAKey OUT: Pointer to public RSA key structure
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Stores private RSA key into RAM for software RSA encryption.
Parameters:
DWORD dwKeyMemory IN: Type of memory where RSA-Key is stored
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 47
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_OUT_OF_RANGE Submitted address and/or size is/are out of the
application's partition area.
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
Generates the private and the public RSA keys and stores them into corresponding RAM.
Parameters:
DWORD dwPublicKeyMemory IN: Type of memory where public RSA Key is stored
RAM1 = 1 / RAM2 = 2 / RAM3 = 3
DWORD dwPublicKeyOffset IN: Public Key offset in RAM
DWORD dwPrivateKeyMemory IN: Type of memory where private RSA Key is stored
RAM1 = 1 / RAM2 = 2 / RAM3 = 3
DWORD dwPrivateKeyOffset IN: Private Key offset in RAM
WORD bits IN: Key length
BYTE * randomPool IN: Pointer to random data, used for key generation
BYTE bPass[0x10] IN: User or Admin Password
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 48
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
This function converts a RSA key from modulus and exponent format into internal CBIOS RSA
key representation to be used by CBIOS RSA encryption calls.
Parameters:
WORD bits IN: Key length
BYTE * pbModulus IN: Pointer to buffer, containing modulus part of RSA key
BYTE * pbExponent IN: Pointer to buffer, containing exponent part of RSA key
BYTE * pbRSAKey OUT: Pointer to buffer, where RSA key in internal format
will be output
Return: None
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 49
Encrypts data with Smarx OS internal RSA key (used for secure communication).
The CRYPTO-BOX XS and Versa models provide RSA support in software (on driver level).
The CRYPTO-BOX SC provides hardware-based RSA (key never leaves the hardware). For
this device type, hardware-based RSA encryption/decryption is used for all operations with
Smarx OS internal RSA keys.
Parameters:
DWORD dwKeyID IN: Shows which RSA key will be used - your Public or
CRYPTO-BOX's Private:
(CBIOS_INTERNAL_RSA_ID_PUBL1 or
CBIOS_INTERNAL_RSA_ID_PRIV2)
PVOID pInBuffer IN: Pointer to original data
DWORD dwInBufferLen IN: Length of original data
PVOID pOutBuffer OUT: Pointer to encrypted data
DWORD *dwOutBufferLen OUT: Pointer to length of encrypted data
BYTE bPass[16] IN: User Password, in case if
CBIOS_INTERNAL_RSA_ID_PRIV2 is used
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_WRONG_PARAM Invalid dwKeyID value
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 50
Decrypts data with Smarx OS internal RSA key (used for secure communication).
Parameters:
DWORD dwKeyID Shows which RSA key will be used - your Public or
CRYPTO-BOX's Private:
(CBIOS_INTERNAL_RSA_ID_PUBL1 or
CBIOS_INTERNAL_RSA_ID_PRIV2)
PVOID pInBuffer IN: Pointer to encrypted data
DWORD dwInBufferLen IN: Length of encrypted data
PVOID pOutBuffer OUT: Pointer to decrypted data
DWORD *dwOutBufferLen OUT: Pointer to length of decrypted data
BYTE bPass[16] User Password, in case if
CBIOS_INTERNAL_RSA_ID_PRIV2 is used
Return:
CBIOS_ERR_EXTENDED_MODE CBIOS is in extended mode, regular function calls are
not allowed in this mode.
CBIOS_ERR_LOCK_TIMEOUT CRYPTO-BOX could not be reached for more than 20
seconds (see CBIOS_LockBox).
CBIOS_ERR_BOX_NOT_OPENED CRYPTO-BOX was not opened with CBIOS_Open
CBIOS_ERR_WRONG_PARAM Invalid dwKeyID value
Otherwise, standard error code will be returned (codes from 0x01 to 0x0A, 0x10XX, see
cbios.h).
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 51
Description: This function generates CBU SC RSA keypair of 512/1024/2048 bits size (bits)
and saves the resulting keypair to the pRSAKeyPair structure.
In addition it saves the public part of the keypair separately to the pRSAPublicKey structure.
The generation is software based and is supposed to be done on trusted computer. If
pRSAPublicKey is null, then this parameter is ignored.
Further the resulting keypair can be saved to one of the cells in CBU SC dedicated memory
(RAM4 zone) with the CBIOS_CBU2_SetKeyRSA() call. If necessary its access rights can be
adjusted with the CBIOS_CBU2_SetKeyInfoRSA() function. Then it can be used for CBU
SC RSA encryption: CBIOS_EncryptRSAEx()/CBIOS_DecryptRSAEx().
[in] Index of RSA cell in CBU SC RAM4 zone for this keypair
dwKeyIndex
(starting from 0)
pRSAKeyPair [in] Pointer to RSA keypair to write
pRSAKeyInfo [in] Pointer to RSA keypair information (optional)
[return] CBIOS Error code
Description: This function writes CBU SC RSA keypair (pRSAKeyPair) to one of CBU SC cells
(dwKeyIndex) in dedicated memory (RAM4 zone).
The pRSAKeyInfo structure can optionally set access rights on this keypair, including:
• its usage for encryption,
• obtaining access rights info and/or changing the keypair value/access rights.
See section 1.7.7.4 for more details on how to define access rights and limitations in
CBIOS_RSA_KEY_INFO structure.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 52
Description: This function changes access rights and limitations for CBU SC RSA cell
(dwKeyIndex) to values defined in the pRSAKeyInfo structure.
It can change access rights for this keypair on: its usage for encryption, obtaining access
rights info and/or changing the keypair value/access rights. See section 1.7.7.4 for more
details on how to define access rights and limitations in CBIOS_RSA_KEY_INFO structure.
Description: This function retrieves access rights and limitations data for CBU SC RSA cell
(dwKeyIndex) to the pRSAKeyInfo structure. See section 1.7.7.4 for more details on how to
define/interpret access rights and limitations in CBIOS_RSA_KEY_INFO structure.
Example: the Test_RSA_HW (void) function of CBU2_Sample.c (MSVS 2005 or 2008 static
sample included to the Smarx PPK) illustrates this call usage.
Description: This function locks the CBU SC RSA cell (dwKeyIndex), so its keypair can not be
used for further RSA encryption/decryption operations.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 53
Description: This function performs CBU SC hardware based RSA encryption using
dwKeyIndex cell in RAM4 CBU SC memory as RSA key holder.
The input data (byte array pInBuffer of length dwInBufferLen) will be encrypted and the
result of this operation will be placed to the pOutBuffer of length defined by
pdwOutBufferLen. On return the pdwOutBufferLen will contain the number of encrypted
bytes or required size of pOutBuffer (if size of the pOutBuffer is not enough).
This function should be considered in combination with CBU SC hardware or software based
RSA decryption. In other words some data being encrypted with public/private RSA key with
this function can be decrypted with private/public RSA key of the same keypair using CBU SC
hardware (CBIOS_CBU2_DecryptRSA – see below) or software (CBIOS_DecryptRSAEx)
RSA decryption.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 54
(MSVS 2005 or 2008 static sample included to the Smarx PPK) illustrates this call usage.
Description: This function performs CBU SC hardware based RSA decryption using
dwKeyIndex cell in RAM4 CBU SC memory as RSA key holder.
The dwMode parameter defines
1) which part of the keypair should be used: public or private;
2) RSA padding mode: CBU RSA/PKCS#1.
The input data (byte array pInBuffer of length dwInBufferLen) will be decrypted and the
result of this operation will be placed to the pOutBuffer of length defined by
pdwOutBufferLen. On return the pdwOutBufferLen will contain the number of decrypted
bytes or required size of pOutBuffer (if size of pOutBuffer is not enough).
This function should be considered in combination with CBU SC hardware or software based
RSA encryption. In other words some data being decrypted with public/private RSA key with
this function can be encrypted with private/public RSA key of the same keypair using CBU SC
hardware (CBIOS_CBU2_EncryptRSA – see above) or software (CBIOS_EncryptRSAEx –
see) RSA encryption.
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 55
(MSVS 2005 or 2008 static sample included to the Smarx PPK) illustrates this call usage.
[in] Points to RSA keypair (for private encryption) or public key (for
pRSAKeyPair
public encryption).
dwMode [in] Defines key type and encryption padding mode, the value is
bitwise combination of (for compatibility with CBU SC hardware RSA
encryption the key type may be specified explicitly):
CBIOS_RSA_PUBL_KEY – encrypt with public key
CBIOS_RSA_PRIV_KEY – encrypt with private key
and
CBIOS_RSA_MARX_PADDING - use CBU RSA padding
CBIOS_RSA_RSAREF_PADDING – use PKCS#1 compliant padding
pInBuffer [in] Pointer to input buffer in computer memory (points to byte array
to encrypt)
dwInBufferLen [in] Size in bytes of pInBuffer.
pOutBuffer [in] Pointer to buffer that will receive encrypted data from pInBuffer
[in, out] Pointer to a variable containing the pOutBuffer size (in
pdwOutBufferLen bytes). On return it contains number of encrypted bytes or required
size of pOutBuffer
[return] CBIOS Error code.
Description: This function performs software based RSA encryption using pRSAKeyPair as a
pointer to the structure containing RSA private or public key. The software based RSA
encryption is 100% compatible with CBU SC hardware based RSA.
The dwMode parameter optionally (for compatibility with CBU SC hardware encryption)
defines which part of the keypair should be used: public or private. It can also define RSA
padding mode: CBU RSA/PKCS#1.
The input data (byte array pInBuffer of length dwInBufferLen) will be encrypted and the
result of this operation will be placed to the pOutBuffer of length defined by
pdwOutBufferLen. On return the pdwOutBufferLen will contain the number of encrypted
bytes or required size of pOutBuffer (if size of pOutBuffer is not enough).
This function should be considered in combination with CBU SC hardware or software based
RSA decryption. In other words some data being encrypted with public/private RSA key with
this function can be decrypted with private/public RSA key of the same keypair using CBU SC
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 56
[in] Points to RSA keypair (for private decryption) or public key (for
pRSAKeyPair
public decryption).
dwMode [in] Defines key type and decryption padding mode, the value is
bitwise combination of (for compatibility with CBU SC hardware RSA
encryption the key type may be specified explicitly):
CBIOS_RSA_PUBL_KEY – decrypt with public key
CBIOS_RSA_PRIV_KEY – decrypt with private key
and
CBIOS_RSA_MARX_PADDING - use CBU RSA padding
CBIOS_RSA_RSAREF_PADDING – use PKCS#1 compliant padding
pInBuffer [in] Pointer to input buffer in computer memory (points to byte array
to decrypt)
dwInBufferLen [in] Size in bytes of pInBuffer
pOutBuffer [in] Pointer to buffer that will receive decrypted data from pInBuffer
Description: This function performs software based RSA decryption using pRSAKeyPair as a
pointer to the structure containing RSA private or public key. The software based RSA
encryption is 100% compatible with CBU SC hardware based RSA.
The dwMode parameter optionally (for compatibility with CBU SC hardware decryption)
defines which part of the keypair should be used: public or private. It can also define RSA
padding mode: CBU RSA/PKCS#1.
The input data (byte array pInBuffer of length dwInBufferLen) will bedecrypted and the result
of this operation will be placed to the pOutBuffer of length defined by pdwOutBufferLen. On
return the pdwOutBufferLen will contain the number of decrypted bytes or required size of
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 57
This function should be considered in combination with CBU SC hardware or software based
RSA encryption. In other words some data being decrypted with public/private RSA key with
this function can be encrypted with private/public RSA key of the same keypair using CBU SC
hardware (CBIOS_CBU2_EncryptRSA) or software (CBIOS_EncryptRSAEx – see above)
RSA decryption.
typedef struct {
DWORD dwStructSize;
WORD wModulusLen; // in bytes, must be a multiple of four bytes
WORD wPrivExpLen; // in bytes, must be a multiple of four bytes
BYTE ubModulus[CBIOS_CBU2_MAX_RSA_KEY_LEN]; // most significant byte first
BYTE ubPrivExp[CBIOS_CBU2_MAX_RSA_KEY_LEN]; // most significant byte first
} CBIOS_RSA_KEY;
CBIOS_RSA_KEY_INFO
This structure defines access rights and limitations for CBU SC RSA keypair: its usage for
encryption, obtaining access rights info and/or changing the keypair value/access rights.
typedef struct {
DWORD dwStructSize;
DWORD dwAccess; // low nibble: SetKey/SetKeyInfo access rights,
// high nibble: Encrypt/Decrypt and GetKeyInfo
WORD wBits;
} CBIOS_RSA_KEY_INFO;
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 58
Comment: The dwAccess member of this structure defines required access rights or returns
current access rights for RSA keypair. For any CBU SC RSA keypair access rights can be set
for:
• encryption/decryption and obtaining information on this keypair (key strength and current
access rights)
• changing the keypair value
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
1. Smarx®OS CBIOS API Reference 59
Calculates MD5 hash from any byte sequence that is submitted via input buffer. For MD5
hash calculation CRYPTO-BOX presence is not required.
Parameters:
PVOID pInBuffer IN: Points on input bytes sequence
DWORD dwInBufferLen IN: Length of input bytes sequence
PVOID pOutBuffer OUT: Points on calculated bytes sequence
DWORD *dwOutBufferLen OUT: Points on length of calculated bytes sequence
Return:
0 if success
errorcode see cbios.h for details
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
2. Smarx®OS Networking: CBIOS on the Network 60
This document contains the network API reference only. Please read our White Paper
Network Licensing with the CRYPTO-BOX for an introduction to network usage. This
document also describes the administration of the network server.
Parameters:
DWORD dwScanTimeMs IN: Scan time in milliseconds
Return:
Number of Smarx OS Network Servers found in the network.
CBIOS looks for the defined scan time whether it finds any servers in the local network and
stops searching after this time, regardless if server(s) were found or not. Searching for
servers is done via UDP broadcasting, by default port 8766 is used (see also
CBIOS_SetScanPort. See our White Paper Network Licensing with the CRYPTO-BOX,
chapter 4 for more details.
Example:
int n = CBIOS_ScanNetwork(2000);
// n - number of found CBIOS Network servers
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
2. Smarx®OS Networking: CBIOS on the Network 61
Set UDP port used for network searching (default port 8766 is used if not set)
Parameters:
WORD wUDPPort IN: UDP Port
Return:
Always 0 – Success
Get UDP port used for network searching (default port 8766 is used if not set)
Parameters:
WORD* pwUDPPort OUT: UDP Port
Return:
0 Success
CBIOS_ERR_WRONG_PARAM pwUDPPort is NULL)
Parameters:
INT32 iServerIndex IN: Server# from 1 to <Servers Quantity> value,
Returned by the preceding CBIOS_ScanNetwork() call
CBIOS_SERVER_INFO* IN/OUT: Pointer to the structure which contains Server
pServerInfo information.
Return:
0 Success
CBIOS_ERR_WRONG_PARAM Invalid iServerIndex or pServerInfo is NULL
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
2. Smarx®OS Networking: CBIOS on the Network 62
Parameters:
CHAR * ServerName IN: Server Network Name or IP address
USHORT Port IN: Server Port
Return:
0 Success
CBIOS_ERR_WRONG_PARAM Wrong server name submitted
CBIOS_ERR_CONN_REFUSED Remote procedure call on server side produced an
error.
Standard CBIOS error See cbios.h for details
Parameters: None
Return:
0 Success
CBIOS_ERR_CONN_REFUSED Remote procedure call on server side produced an
error.
Standard CBIOS error See cbios.h for details
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
2. Smarx®OS Networking: CBIOS on the Network 63
Parameters: None
Return:ReleaseLicense
0 Success
CBIOS_ERR_NO_FREE_License There's no free license for application
CBIOS_ERR_CONN_REFUSED Error during remote procedure call on server side.
Standard CBIOS error See cbios.h for details
Parameters: None
Return:
0 Success
CBIOS_ERR_CONN_REFUSED Error during remote procedure call on server side.
Standard CBIOS error See cbios.h for details
Reads information about the application's local and network licenses from the LMT.
Parameters:
WORD wAppId IN: Application/partition number
DWORD * pdwRuleId OUT: Pointer to license rule identifier
DWORD * pdwNetLic OUT: Pointer to network license value
Return:
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
2. Smarx®OS Networking: CBIOS on the Network 64
0 Success
CBIOS_ERR_NOT_LICENSED Application/partition is not licensed
CBIOS_ERR_CONN_REFUSED Remote procedure call on server side produced an
error.
Standard CBIOS error See cbios.h for details
Writes information about the application's local and network licenses to the LMT.
Parameters:
WORD wAppId IN: Application/partition number
DWORD dwReserved IN: Reserved (would be 0)
DWORD dwNetLic IN: Network license value
BYTE bPass[0x10] IN: Admin Password (APW)
Return:
0 Success
CBIOS_ERR_NOT_LICENSED Application/partition is not licensed
CBIOS_ERR_CONN_REFUSED Remote procedure call on server side produced an
error.
Standard CBIOS error see cbios.h for details
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
2. Smarx®OS Networking: CBIOS on the Network 65
Writes information about the application network licenses and license distribution rule to the
LMT.
Licenses rule ID :
CBIOS_NET_LICENCE_RULE_ Licenses are locked without taking client’s IP/Terminal
DEFAULT (0) Session into account (default scenario),
CBIOS_LockLicenceExt will deduct one license for each
application instance, regardless of whether the protected
application is started several times on one computer/IP
address/Terminal Session or on different computers/IP
addresses/Terminal Sessions).
CBIOS_NET_LICENCE_RULE_ "One license per one IP", CBIOS_LockLicenceExt will
IP_1L (1) deduct only one license per IP address (unlimited
number of instances can be launched concurrently from
one IP).
Important Note: This option does not consider Terminal
Server Session!
CBIOS_NET_LICENCE_RULE_ "One seat per User and MAC address" for dynamic IP,
MACADD_TS_1L (2) CBIOS_LockLicenceExt will deduct only one license for:
– one MAC address (unlimited number of instances can
be launched concurrently from one MAC)
– one Terminal Session (unlimited number of instances
can be launched concurrently in the same TS)
CBIOS_NET_LICENCE_RULE_ "One seat per IP, User and MAC address" for static IP,
IPADD_TS_1L (3) CBIOS_LockLicenceExt will deduct only one license for
each Terminal Server Session (no matter how often the
application is started in this Terminal Server Session with
a particular IP address). The same as
CBIOS_NET_LICENCE_RULE_MACADD_TS_1L + IP
Parameters:
WORD wAppId IN: Application/partition number
BYTE bRuleId IN: License rule identifier
BYTE bNetLic IN: Network license value
BYTE bPass[0x10] IN: Admin Password (APW)
Return:
0 Success
CBIOS_ERR_NOT_LICENSED Application/partition is not licensed
CBIOS_ERR_OUT_OF_RANGE Invalid rule id
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
2. Smarx®OS Networking: CBIOS on the Network 66
Retrieves information about free (not busy) local and network licenses of an application.
Parameters:
WORD wAppId IN: Application/partition number
DWORD * pdwRuleId OUT: Pointer to license rule identifier
DWORD * pdwNetLic OUT: Pointer to network license value
Return:
0 Success
CBIOS_ERR_NOT_LICENSED Application/partition is not licensed
CBIOS_ERR_CONN_REFUSED Remote procedure call on server side produced an
error.
Standard CBIOS error see cbios.h for details
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
3. Contact and Support 67
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
3. Contact and Support 68
4. Alphabetical Index
A CBIOS_GetAppInfoI 13
Administrator Password (APW) 26, 28 CBIOS_GetAppLicences 63
AES CBIOS_GetBoxInfo 8
Fixed IV 31 CBIOS_GetBoxInfoAdv 9
Fixed Key 31 CBIOS_GetBoxInfoAdvI 9
Private IV 31f. CBIOS_GetBoxInfoI 8
Private Key 30, 32 CBIOS_GetDeveloperIDI 11
Session IV 30, 33 CBIOS_GetDriverLastError 14
Session Key 29, 33 CBIOS_GetHWRand 27
Application (Partition) 17 CBIOS_GetKeyPrivateRSA 45
CBIOS_GetKeyPublicRSA 43f.
C CBIOS_GetLastError 7
CBIOS_AES_KEY 36 CBIOS_GetSerialNum 12
CBIOS_AES_KEY_INFO 36 CBIOS_GetSerialNumI 11f.
CBIOS_APWLogin 26 CBIOS_LockBox 18
CBIOS_CBU2_CryptAES 35 CBIOS_LockLicence 20, 62, 65
CBIOS_CBU2_DecryptRSA 54 CBIOS_LockLicenceExt 20
CBIOS_CBU2_EncryptRSA 53 CBIOS_Logout 26
CBIOS_CBU2_GetKeyInfoAES 34 CBIOS_OpenByApp 17
CBIOS_CBU2_GetKeyInfoRSA 52 CBIOS_OpenByIndex 14
CBIOS_CBU2_LockKeyAES 35 CBIOS_OpenByLabel 16
CBIOS_CBU2_LockKeyRSA 52 CBIOS_OpenByName 15
CBIOS_CBU2_SetKeyAES 33 CBIOS_PrepareRSAKey 48
CBIOS_CBU2_SetKeyInfoAES 34 CBIOS_ReadRAM1 37
CBIOS_CBU2_SetKeyInfoRSA 52 CBIOS_ReadRAM2 38
CBIOS_CBU2_SetKeyRSA 51 CBIOS_ReadRAM3 40
CBIOS_CheckAppLicence 66 CBIOS_RegisterNotificationCallback 8, 22
CBIOS_CheckBox 21 CBIOS_RegisterNotificationMessage 8, 23
CBIOS_Close 18 CBIOS_ReleaseLicence 21, 63
CBIOS_CryptFixed 31 CBIOS_RSA_KEY 57
CBIOS_CryptPrivate 32 CBIOS_RSA_KEY_INFO 57
CBIOS_CryptSession 33 CBIOS_ScanBoxes 7
CBIOS_DecryptInternalRSA 50 CBIOS_SetAppLicences 64
CBIOS_DecryptRSA 43 CBIOS_SetAPW 28
CBIOS_DecryptRSAEx 56 CBIOS_SetIVPrivate 31
CBIOS_EncryptInternalRSA 49 CBIOS_SetIVSession 30
CBIOS_EncryptRSA 42 CBIOS_SetKeyPrivate 30
CBIOS_EncryptRSAEx 55 CBIOS_SetKeyPrivateRSA 46
CBIOS_Finish 7 CBIOS_SetKeyPublicRSA 46
CBIOS_FinishDLL 7 CBIOS_SetKeySession 29
CBIOS_GenerateKeyPairRSA 47 CBIOS_SetLabel 25
CBIOS_GenerateKeyPairRSAEx 50 CBIOS_SetRuleAppLicences 21, 65
CBIOS_GetAppInfo 13 CBIOS_SetUPW 28
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP
4. Alphabetical Index 69
D S
Delphi 6 Search CRYPTO-BOXes 7
Developer ID 11 Support 67
H T
Hash Algorithm 59 Terminal Server 20, 65
Terminal Session 65
L
License Rule 65 U
USB events 22f.
M User Password (UPW) 25, 28
MAC address 65
V
N Visual Basic 6
Network
Check Licenses 66 W
Connect 62 Windows Terminal Server 20, 65
0-20May010ks(CBIOS API Reference).odt
CBIOS API Reference November 2021 Copyright © 2002, 2021 MARX® CryptoTech LP