Defines the cryptographic abstraction interface for the SOPC_CryptoProvider. A cryptographic implementation must define all the functions declared in this file.
More...
Go to the source code of this file.
Defines the cryptographic abstraction interface for the SOPC_CryptoProvider. A cryptographic implementation must define all the functions declared in this file.
◆ SOPC_CryptoProvider_Init()
Initializes a SOPC_CryptoProvider context. Called by SOPC_CryptoProvider_Create() upon context creation.
- Parameters
-
- Note
- The implementation is specific to the chosen cryptographic library.
-
Internal API.
- Returns
- SOPC_STATUS_OK when successful, SOPC_STATUS_INVALID_PARAMETERS when
pCryptoProvider
is NULL, SOPC_STATUS_NOK otherwise.
◆ SOPC_CryptoProvider_Deinit()
Deinitialize a SOPC_CryptoProvider context (this process is specific to the chosen cryptographic library). Called by SOPC_CryptoProvider_Free() upon context destruction.
- Parameters
-
pCryptoProvider | A Cryptographic context to be uninitialized. |
- Note
- The implementation is specific to the chosen cryptographic library.
-
Internal API.
- Returns
- SOPC_STATUS_OK when successful, SOPC_STATUS_INVALID_PARAMETERS when
pCryptoProvider
is NULL.
◆ SOPC_CryptoProvider_AsymmetricGetLength_KeyBits()
Writes the length in bits in pLenKeyBits
of the asymmetric key pKey
.
The main purpose of this function is to verify the length of the modulus of the asymmetric key pKey
with respect to the security policy.
- Parameters
-
pProvider | An initialized cryptographic context. |
pKey | A valid pointer to an SOPC_AsymmetricKey. |
pLenKeyBits | A valid pointer to the output length in bits. Its content is unspecified when return value is not SOPC_STATUS_OK. |
- Note
- The implementation is specific to the chosen cryptographic library.
-
Specific to client-server security policies.
- Returns
- SOPC_STATUS_OK when successful, SOPC_STATUS_INVALID_PARAMETERS when parameters are NULL or
pProvider
not correctly initialized.
◆ SOPC_CryptoProvider_AsymmetricGetLength_MsgPlainText()
Provides the maximum length in bytes of a message to be encrypted with a single asymmetric encryption operation.
- Parameters
-
pProvider | An initialized cryptographic context. |
pKey | A valid pointer to an SOPC_AsymmetricKey. |
pLenMsg | A valid pointer to the length in bytes of the maximum length in bytes of the plain text message used by the encryption process. |
- Note
- The implementation is specific to the chosen cryptographic library.
-
Specific to client-server security policies.
- Returns
- SOPC_STATUS_OK when successful, SOPC_STATUS_INVALID_PARAMETERS when parameters are NULL or
pProvider
not correctly initialized.
◆ SOPC_CryptoProvider_AsymmetricGetLength_MsgCipherText()
Provides the length in bytes of a ciphered message to be decrypted with a single asymmetric decryption operation.
- Parameters
-
pProvider | An initialized cryptographic context. |
pKey | A valid pointer to an SOPC_AsymmetricKey. |
pLenMsg | A valid pointer to the length in bytes of the ciphered message used by the decryption process. |
- Note
- The implementation is specific to the chosen cryptographic library.
-
Specific to client-server security policies.
- Returns
- SOPC_STATUS_OK when successful, SOPC_STATUS_INVALID_PARAMETERS when parameters are NULL or
pProvider
not correctly initialized.