TrustCore SDK NanoCrypto API reference  version 7.0
keyblob.h File Reference

Digicert SoT Platform key blob management code. More...

Go to the source code of this file.

Enumerations

enum  KEYBLOB_TYPE {
  keyblob_type_undefined = 0, keyblob_type_rsa = 0x01, keyblob_type_ecc = 0x02, keyblob_type_dsa = 0x03,
  keyblob_type_rsa_pss = 0x05, keyblob_type_custom = 0x65, keyblob_type_moc = 0x66, keyblob_type_ecc_ed = 112,
  keyblob_type_hybrid = 113, keyblob_type_hsm_rsa = 0x010001, keyblob_type_hsm_ecc = 0x010002, keyblob_tap_rsa = 0x00020001,
  keyblob_tap_ecc = 0x00020002
}
 

Functions

MOC_EXTERN MSTATUS KEYBLOB_extractKeyBlobEx (const ubyte *pKeyBlob, ubyte4 keyBlobLength, AsymmetricKey *pKey)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_extractKeyBlobTypeEx (const ubyte *pKeyBlob, ubyte4 keyBlobLength, ubyte4 *pRetKeyType)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_extractPublicKey (const ubyte *pKeyBlob, ubyte4 keyBlobLength, ubyte **ppRetPublicKeyBlob, ubyte4 *pRetPublicKeyBlobLength, ubyte4 *pRetKeyType)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_makeDSAKeyBlob (MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *pDSAContext, ubyte **ppRetKeyBlob, ubyte4 *pRetKeyLength)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_makeECCKeyBlob (MOC_ECC(hwAccelDescr hwAccelCtx) ECCKey *pECCKey, ubyte4 curveId, ubyte **ppRetKeyBlob, ubyte4 *pRetKeyLength)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_makeHSMRSAKeyBlob (RSAKey *pRSAKey, ubyte **ppRetKeyBlob, ubyte4 *pRetKeyLength)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_makeHybridBlob (ECCKey *pECCKey, QS_CTX *pCtx, ubyte **ppRetKeyBlob, ubyte4 *pRetKeyLength)
 
MOC_EXTERN MSTATUS KEYBLOB_makeKeyBlobEx (const AsymmetricKey *pKey, ubyte **ppRetKeyBlob, ubyte4 *pRetKeyLength)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_makeRSAKeyBlob (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pRSAContext, ubyte **ppRetKeyBlob, ubyte4 *pRetKeyLength)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_parseHeader (const ubyte *pKeyBlob, ubyte4 keyBlobLen, ubyte4 *pKeyType, ubyte4 *pVersion)
 
MOC_EXTERN MSTATUS KEYBLOB_readDSAKeyPart (MOC_DSA(hwAccelDescr hwAccelCtx) const ubyte *pKeyBlob, ubyte4 keyBlobLength, AsymmetricKey *pKey)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_readECCKeyPart (MOC_ECC(hwAccelDescr hwAccelCtx) const ubyte *pKeyBlob, ubyte4 keyBlobLength, AsymmetricKey *pKey)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_readHSMRSAKeyPart (const ubyte *pKeyBlob, ubyte4 keyBlobLength, AsymmetricKey *pKey)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_readOldRSAKeyBlob (MOC_RSA(hwAccelDescr hwAccelCtx) const ubyte *pKeyBlob, ubyte4 keyBlobLength, AsymmetricKey *pKey)
 This is an old function. More...
 
MOC_EXTERN MSTATUS KEYBLOB_readRSAKeyPart (MOC_RSA(hwAccelDescr hwAccelCtx) const ubyte *pKeyBlob, ubyte4 keyBlobLength, AsymmetricKey *pKey)
 This is an old function. More...
 

Detailed Description

This header file contains structures, enumerations, and function declarations for SoT Platform key blob management functions.

Since
1.41
Version
5.3 and later

(new structures, new functions, etc.)

Whether the following flags are defined determines which structures and enumerations are defined:

  • __ENABLE_MOCANA_ECC__

Whether the following flags are defined determines which function declarations are enabled:

  • __PUBCRYPTO_HEADER__

keyblob.h

Function Documentation

◆ KEYBLOB_extractKeyBlobEx()

MOC_EXTERN MSTATUS KEYBLOB_extractKeyBlobEx ( const ubyte *  pKeyBlob,
ubyte4  keyBlobLength,
AsymmetricKey *  pKey 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_extractKeyBlobTypeEx()

MOC_EXTERN MSTATUS KEYBLOB_extractKeyBlobTypeEx ( const ubyte *  pKeyBlob,
ubyte4  keyBlobLength,
ubyte4 *  pRetKeyType 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_extractPublicKey()

MOC_EXTERN MSTATUS KEYBLOB_extractPublicKey ( const ubyte *  pKeyBlob,
ubyte4  keyBlobLength,
ubyte **  ppRetPublicKeyBlob,
ubyte4 *  pRetPublicKeyBlobLength,
ubyte4 *  pRetKeyType 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_makeDSAKeyBlob()

MOC_EXTERN MSTATUS KEYBLOB_makeDSAKeyBlob ( MOC_DSA(hwAccelDescr hwAccelCtx) DSAKey *  pDSAContext,
ubyte **  ppRetKeyBlob,
ubyte4 *  pRetKeyLength 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_makeECCKeyBlob()

MOC_EXTERN MSTATUS KEYBLOB_makeECCKeyBlob ( MOC_ECC(hwAccelDescr hwAccelCtx) ECCKey *  pECCKey,
ubyte4  curveId,
ubyte **  ppRetKeyBlob,
ubyte4 *  pRetKeyLength 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_makeHSMRSAKeyBlob()

MOC_EXTERN MSTATUS KEYBLOB_makeHSMRSAKeyBlob ( RSAKey *  pRSAKey,
ubyte **  ppRetKeyBlob,
ubyte4 *  pRetKeyLength 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_makeKeyBlobEx()

MOC_EXTERN MSTATUS KEYBLOB_makeKeyBlobEx ( const AsymmetricKey *  pKey,
ubyte **  ppRetKeyBlob,
ubyte4 *  pRetKeyLength 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_makeRSAKeyBlob()

MOC_EXTERN MSTATUS KEYBLOB_makeRSAKeyBlob ( MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *  pRSAContext,
ubyte **  ppRetKeyBlob,
ubyte4 *  pRetKeyLength 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_readDSAKeyPart()

MOC_EXTERN MSTATUS KEYBLOB_readDSAKeyPart ( MOC_DSA(hwAccelDescr hwAccelCtx) const ubyte *  pKeyBlob,
ubyte4  keyBlobLength,
AsymmetricKey *  pKey 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_readECCKeyPart()

MOC_EXTERN MSTATUS KEYBLOB_readECCKeyPart ( MOC_ECC(hwAccelDescr hwAccelCtx) const ubyte *  pKeyBlob,
ubyte4  keyBlobLength,
AsymmetricKey *  pKey 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_readHSMRSAKeyPart()

MOC_EXTERN MSTATUS KEYBLOB_readHSMRSAKeyPart ( const ubyte *  pKeyBlob,
ubyte4  keyBlobLength,
AsymmetricKey *  pKey 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_readOldRSAKeyBlob()

MOC_EXTERN MSTATUS KEYBLOB_readOldRSAKeyBlob ( MOC_RSA(hwAccelDescr hwAccelCtx) const ubyte *  pKeyBlob,
ubyte4  keyBlobLength,
AsymmetricKey *  pKey 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.

◆ KEYBLOB_readRSAKeyPart()

MOC_EXTERN MSTATUS KEYBLOB_readRSAKeyPart ( MOC_RSA(hwAccelDescr hwAccelCtx) const ubyte *  pKeyBlob,
ubyte4  keyBlobLength,
AsymmetricKey *  pKey 
)

You should use CRYPTO_serialize to to get key blobs, along with DER and PEM encodings from keys, and CRYPTO_deserialize to build keys from key blobs, DER, and PEM.