Framework for Signing, Verifying, Encrypting and Decrypting of data objects.
More...
|
GWENHYWFAR_API int | GWEN_CryptMgr_Sign (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf) |
|
GWENHYWFAR_API int | GWEN_CryptMgr_Encrypt (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf) |
|
GWENHYWFAR_API int | GWEN_CryptMgr_Verify (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf) |
|
GWENHYWFAR_API int | GWEN_CryptMgr_Decrypt (GWEN_CRYPTMGR *cm, const uint8_t *pData, uint32_t lData, GWEN_BUFFER *dbuf) |
|
Framework for Signing, Verifying, Encrypting and Decrypting of data objects.
This group contains functions which operate on cryptographic objects. These objects are signed objects and encrypted objects. Data can be wrapped in those objects for secure transmission.
Keys used by this group are identified by a name, number and version. There is a local key (used for signing and decryption) and a peer key (used for signature verification and encryption).
This module handles the adminstration of signed objects and encrypted objects. The cryptographic functions are performed using callbacks. Therefore you can't instantiate an object of this group directly. You must call the constructor of one of the implementations (like GWEN_CryptMgrKeys_new).
Signed objects and encrypted objects consist of modified TLV (Tag, Length, Value) objects with the following structure:
Position | Length | Description |
0 | 1 | Type |
1 | 2 | Length of the following value (or 0) |
2 | n | Value |
A signed object is such a TLV object consisting of:
-
signature head (name, number and version of the key used, datetime etc)
-
signed data
-
signature tail containing the actual signature
Encrypted objects are another kind of TLVs containing:
-
crypt head (name, number and version of the key used, message key etc)
-
encrypted data
◆ GWEN_CRYPTMGR_TLV_ENCRYPTEDOBJECT
#define GWEN_CRYPTMGR_TLV_ENCRYPTEDOBJECT 0x22 |
◆ GWEN_CRYPTMGR_TLV_SIGNEDOBJECT
#define GWEN_CRYPTMGR_TLV_SIGNEDOBJECT 0x21 |
◆ GWEN_CRYPTMGR
◆ GWEN_CRYPT_PROFILE
Enumerator |
---|
GWEN_CryptProfile_None | |
GWEN_CryptProfile_1 | Padding for key : ISO 9796-2 Encryption for key : RSA 2048 Padding for data : ANSIX9_23 Encryption for data: BLOWFISH-256
|
Definition at line 67 of file cryptmgr.h.
◆ GWEN_SIGNATURE_PROFILE
Enumerator |
---|
GWEN_SignatureProfile_None | |
GWEN_SignatureProfile_1 | Hash: RMD-160 Padd: ISO 9796-2 Sign: RSA 2048
|
Definition at line 79 of file cryptmgr.h.
◆ GWEN_CryptMgr_Decode()
Decrypt the given data which is expected to be an encrypted object containing a signed object which actually contains the data. The signature of the contained signed object is verified.
◆ GWEN_CryptMgr_Decrypt()
Extracts the data from an encrypted object and decrypts it.
◆ GWEN_CryptMgr_Encode()
Sign the given data (thus creating a signed object) and encrypt the result of that operation (i.e. creating an encrypted object containing a signed object which actually contains the data).
◆ GWEN_CryptMgr_Encrypt()
Encrypt the given data and create an encrypted object containing the encrypted data.
◆ GWEN_CryptMgr_free()
◆ GWEN_CryptMgr_GetCryptProfile()
◆ GWEN_CryptMgr_GetLocalKeyName()
◆ GWEN_CryptMgr_GetLocalKeyNumber()
◆ GWEN_CryptMgr_GetLocalKeyVersion()
◆ GWEN_CryptMgr_GetPeerKeyName()
◆ GWEN_CryptMgr_GetPeerKeyNumber()
◆ GWEN_CryptMgr_GetPeerKeyVersion()
◆ GWEN_CryptMgr_GetSignatureProfile()
◆ GWEN_CryptMgr_SetCryptProfile()
◆ GWEN_CryptMgr_SetSignatureProfile()
◆ GWEN_CryptMgr_Sign()
Sign the given data and create a signed object containing the signature and the given data.
◆ GWEN_CryptMgr_Verify()
Extract the data from a signed object and verify the signature.