KM_ExportToP12Pbe

Wrap private keys and certificates using PKCS #12 export mechanisms.

Synopsis

#include <kmlib.h>

CK_RV KM_ExportToP12Pbe(CK_SESSION_HANDLE        hSession,
                        CK_OBJECT_HANDLE         privKey,
                        CK_OBJECT_HANDLE         keyCert,
                        CK_MECHANISM_TYPE        safeBagKgMech,
                        CK_MECHANISM_TYPE        safeContentKgMech,
                        CK_MECHANISM_TYPE        hmacKgMech,
                        const char              *p12FileName);
Parameter Description
hSession Handle to an open session.
hPrivKey

Handle to private key to be exported.

hKeyCert Handle to certificate to be exported.
safeBagKgMech

Key generation mechanism for SafeBag encryption. Valid options are the following:

>CKM_PBE_SHA1_RC2_40_CBC

>CKM_PBE_SHA1_RC2_128_CBC

>CKM_PBE_SHA1_RC4_40

>CKM_PBE_SHA1_RC4_128

>CKM_PBE_SHA1_DES2_EDE_CBC

>CKM_PBE_SHA1_DES3_EDE_CBC

safeContentKgMech

Key generation mechanism for SafeContent encryption. Valid options are the following:

>CKM_PBE_SHA1_RC2_40_CBC

>CKM_PBE_SHA1_RC2_128_CBC

>CKM_PBE_SHA1_RC4_40

>CKM_PBE_SHA1_RC4_128

>CKM_PBE_SHA1_DES2_EDE_CBC

>CKM_PBE_SHA1_DES3_EDE_CBC

hmacKgMech

Key generation mechanism for HMAC:

>CKM_PBA_SHA1_WITH_SHA1_HMAC

p12FileName

File name for output.

Returns

CKR_OK if successful, otherwise other CK_RV value.

Delete this text and replace it with your own content.