TrustCore SDK NanoCert API reference  version 7.0
pkcs12.h File Reference

Header file for SoT Platform PKCS #12 convenience API. More...

Go to the source code of this file.

Data Structures

struct  PKCS12AttributeUserValue
 Nickname and/or identifier for keys; as defined in Section 4.2, "PKCS12AttrSet,", in PKCS 12 v1.0: Personal Information Exchange Syntax, available at ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12v1.pdf. More...
 
struct  PKCS12DataObject
 Content to be published in the PKCS #12 file with the privacy mode. More...
 
struct  PKCS12PrivacyModeConfig
 Configuration information for PKCS 12 privacy (encryption) operations. More...
 

Typedefs

typedef MSTATUS(* PKCS12_contentHandler) (const void *context, contentTypes type, ubyte4 extraInfo, const ubyte *content, ubyte4 contentLen)
 Process and return the information extracted from a PFX PDU. More...
 

Enumerations

enum  certTypes { X509 = 1, SDSI =2 }
 Enumeration of certificate types for PKCS #12. More...
 
enum  contentTypes { KEYINFO, CERT, CRL }
 Enumeration of content types for PKCS #12. More...
 
enum  ePKCS12AttributeType { PKCS12_AttributeType_friendlyName = 0, PKCS12_AttributeType_localKeyId }
 Enumeration of PKCS #12 attributes. More...
 
enum  ePKCS12Mode {
  PKCS12Mode_Privacy_none = 0, PKCS12Mode_Privacy_data, PKCS12Mode_Privacy_password, PKCS12Mode_Privacy_pubKey,
  PKCS12Mode_Integrity_password, PKCS12Mode_Integrity_pubKey
}
 Enumeration of PKCS12 encryption and integrity modes. More...
 

Functions

MOC_EXTERN MSTATUS PKCS12_decrypt (MOC_SYM(hwAccelDescr hwAccelCtx) ASN1_ITEMPTR pEncryptedData, ASN1_ITEMPTR pAlgoIdentifier, CStream s, const ubyte *password, sbyte4 passwordLen, ubyte **decryptedInfo, sbyte4 *decryptedInfoLen)
 Decrypt data according to a given algorithm, pAlgorithmIdentifier. More...
 
MOC_EXTERN MSTATUS PKCS12_DecryptPFXPduPwMode (ubyte *pPkcs12Data, ubyte4 pkcs12DataLen, ubyte *pEncPw, ubyte4 encPwLen, ubyte *pPrivacyPswd, ubyte4 privacyPswdLen, ubyte *pIntegrityPswd, ubyte4 integrityPswdLen, SizedBuffer **ppCerts, ubyte4 *pCertCount, ubyte **ppKeyBlob, ubyte4 *pKeyBlobLen)
 Decrypt a password integrity mode encrypted PFX PDU. More...
 
MOC_EXTERN MSTATUS PKCS12_encrypt (MOC_SYM(hwAccelDescr hwAccelCtx) ubyte pbeSubType, const ubyte *password, sbyte4 passwordLen, const ubyte *salt, sbyte4 saltLen, ubyte4 iterCount, ubyte *plainText, sbyte4 plainTextLen)
 Encrypt a buffer, typically a public key, according to the specified algorithm. More...
 
MOC_EXTERN MSTATUS PKCS12_EncryptPFXPdu (MOC_HW(hwAccelDescr hwAccelCtx) randomContext *pRandomContext, ubyte4 integrityMode, const ubyte *pIntegrityPswd, ubyte4 integrityPswdLen, AsymmetricKey *pVsrcSigK, const ubyte *pDigestAlgoOID, CStream csSignerCertificate[], ubyte4 numSignerCerts, const PKCS12PrivacyModeConfig *pPkcs12PrivacyModeConfig, PKCS12DataObject pkcs12DataObject[], ubyte4 numPKCS12DataObj, ubyte **ppRetPkcs12CertDer, ubyte4 *pRetPkcs12CertDerLen)
 Create an encrypted PFX PDU. More...
 
MOC_EXTERN MSTATUS PKCS12_EncryptPFXPduCertMode (randomContext *pRandomContext, SizedBuffer *pCerts, ubyte4 certCount, ubyte *pKeyBlob, ubyte4 keyBlobLen, ubyte *pCA, ubyte4 caLen, ubyte *pEncPw, ubyte4 encPwLen, ubyte4 pkcs12EncryptionType, ubyte *pEncKeyCert, ubyte4 encKeyCertLen, const ubyte *pEncAlgoId, ubyte *pIntegrityKeyblob, ubyte4 integrityKeyblobLen, ubyte *pIntegrityCert, ubyte4 integrityCertLen, const ubyte *pDigestAlgoOID, ubyte **ppRetPkcs12CertDer, ubyte4 *pRetPkcs12CertDerLen)
 Create a key integrity mode encrypted PFX PDU. More...
 
MOC_EXTERN MSTATUS PKCS12_EncryptPFXPduPwMode (randomContext *pRandomContext, SizedBuffer *pCerts, ubyte4 certCount, ubyte *pKeyBlob, ubyte4 keyBlobLen, ubyte *pCA, ubyte4 caLen, ubyte *pEncPw, ubyte4 encPwLen, ubyte4 pkcs12EncryptionType, ubyte *pPrivacyPswd, ubyte4 privacyPswdLen, ubyte *pIntegrityPswd, ubyte4 integrityPswdLen, ubyte **ppRetPkcs12CertDer, ubyte4 *pRetPkcs12CertDerLen)
 Create a password integrity mode encrypted PFX PDU. More...
 
MOC_EXTERN MSTATUS PKCS12_ExtractInfo (MOC_HW(hwAccelDescr hwAccelCtx) ASN1_ITEM *pRootItem, CStream s, const ubyte *uniPassword, sbyte4 uniPassLen, void *pkcs7CBArg, PKCS7_Callbacks *pkcs7CBs, void *handlerContext, PKCS12_contentHandler handler)
 Extract and decrypt information from a PFX PDU, and submit the information to the given callback. More...
 
MOC_EXTERN const BulkEncryptionAlgoPKCS12_GetEncryptionAlgo (ubyte pbeSubType)
 Return function pointers for create, delete, and decrypt/encrypt operations for the specified PBE sub type. More...
 

Variables

MOC_EXTERN const ubyte pkcs12_bagtypes_root_OID []
 
MOC_EXTERN const ubyte pkcs12_Pbe_root_OID []
 

Detailed Description

Header file for SoT Platform PKCS #12 convenience API.

Enumeration Type Documentation

◆ certTypes

enum certTypes

Enumeration of certificate types for PKCS #12; defined in pkcs12.h.

◆ contentTypes

Enumeration of content types for PKCS #12; defined in pkcs12.h.

◆ ePKCS12AttributeType

Enumeration of PKCS #12 attributes; defined in pkcs12.h.

◆ ePKCS12Mode

Enumeration of PKCS12 encryption and integrity modes; defined in pkcs12.h.