![]() |
TrustCore SDK Crypto Interface API reference
version 2.0
|
Cryptographic Interface header file for declaring RSA functions. More...
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_applyPrivateKeyAux (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, RNGFun rngFun, void *rngFunArg, ubyte *pInput, ubyte4 inputLen, ubyte **ppOutput, vlong **ppVlongQueue) |
Apply the private key to the input data. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_applyPublicKeyAux (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte *pInput, ubyte4 inputLen, ubyte **ppOutput, vlong **ppVlongQueue) |
Apply the public key to the input data. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_byteStringFromKey (MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, ubyte *pBuffer, ubyte4 *pRetLen) |
Convert RSA key to a string of (PKCS #1) bytes. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_cloneKey (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey **ppNewKey, const RSAKey *pSrc, vlong **ppVlongQueue) |
Clone (copy) an RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_createKey (void **ppNewKey, ubyte4 keyType, void *pKeyAttributes) |
Create a new RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_createKeyAux (RSAKey **ppNewKey) |
Create a new RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_decryptAux (MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, const ubyte *pCipherText, ubyte *pPlainText, ubyte4 *pPlainTextLen, RNGFun rngFun, void *pRngFunArg, vlong **ppVlongQueue) |
Decrypts the given cipher text using RSA decryption. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_encryptAux (MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, const ubyte *pPlainText, ubyte4 plainTextLen, ubyte *pCipherText, RNGFun rngFun, void *pRngFunArg, vlong **ppVlongQueue) |
Creates RSA encryption. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_equalKey (MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey1, const RSAKey *pKey2, byteBoolean *pRes) |
Determine whether two RSA keys are equal. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_freeKeyAux (RSAKey **ppRsaKey, vlong **ppVlongQueue) |
Free an RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_freeKeyTemplateAux (RSAKey *pKey, MRsaKeyTemplate *pTemplate) |
Free the RSA key template. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_generateKey (MOC_RSA(hwAccelDescr hwAccelCtx) randomContext *pRandomContext, RSAKey *pRsaKey, ubyte4 keySize, vlong **ppVlongQueue) |
Generate a key pair for pRsaKey using pRandomContext for entropy. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_generateKeyAlloc (MOC_RSA(hwAccelDescr hwAccelCtx) randomContext *pRandomContext, void **ppNewKey, ubyte4 keySize, vlong **ppVlongQueue, ubyte4 keyType, void *pKeyAttributes) |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_getCipherTextLengthAux (MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, sbyte4 *pCipherTextLen) |
Get length of cipher text associated with RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_getKeyBitLen (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte4 *pBitLen) |
Gets the bitlength of an RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_getKeyParametersAllocAux (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, MRsaKeyTemplate *pTemplate, ubyte keyType) |
Allocates and sets the appropriate key parameters of pTemplate with the data in the key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_keyFromByteString (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey **ppKey, const ubyte *pByteString, ubyte4 len, vlong **ppVlongQueue) |
Make an RSAKey object from a byte string. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_pkcs15Pad (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte4 operation, RNGFun rngFun, void *pRngFunArg, ubyte *pM, ubyte4 mLen, ubyte **ppRetPaddedMsg, ubyte4 *pRetPaddedMsgLen) |
Used to generated PKCS 1.5 padded data. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_setAllKeyDataAux (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte *pPubExpo, ubyte4 pubExpoLen, const ubyte *pModulus, ubyte4 modulusLen, const ubyte *pPrime1, ubyte4 prime1Len, const ubyte *pPrime2, ubyte4 prime2Len, vlong **ppVlongQueue) |
Set all the parameters in a RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_setAllKeyParameters (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte4 exponent, const ubyte *modulus, ubyte4 modulusLen, const ubyte *prime1, ubyte4 prime1Len, const ubyte *prime2, ubyte4 prime2Len, vlong **ppVlongQueue) |
Set all the parameters in a RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_setPublicKeyData (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte *pPubExpo, ubyte4 pubExpoLen, const ubyte *pModulus, ubyte4 modulusLen, vlong **ppVlongQueue) |
Set the public parameters of an RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_setPublicKeyParametersAux (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte4 exponent, const ubyte *pModulus, ubyte4 modulusLen, vlong **ppVlongQueue) |
Set the public parameters of an RSA key. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_signMessageAux (MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, const ubyte *pPlainText, ubyte4 plainTextLen, ubyte *pCipherText, vlong **ppVlongQueue) |
Uses an RSA key to sign the plain text and write to pCipherText. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_verifyDigest (MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey *pKey, ubyte *pMsgDigest, ubyte4 digestLen, ubyte *pSignature, ubyte4 sigLen, intBoolean *pIsValid, vlong **ppVlongQueue) |
Verify the digest of a message. More... | |
MOC_EXTERN MSTATUS | CRYPTO_INTERFACE_RSA_verifySignatureAux (MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey *pKey, const ubyte *pCipherText, ubyte *pPlainText, ubyte4 *pPlainTextLen, vlong **ppVlongQueue) |
Uses an RSA key to verify the signature and write to pCipherText. More... | |
Add details here.
MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_applyPrivateKeyAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
RNGFun | rngFun, | ||
void * | rngFunArg, | ||
ubyte * | pInput, | ||
ubyte4 | inputLen, | ||
ubyte ** | ppOutput, | ||
vlong ** | ppVlongQueue | ||
) |
The input data must be the same length as the RSA modulus. The output buffer will be allocated by this function and must be freed by the caller.
pKey | The key used to perform the operation. This must contain RSA private key data. |
rngFun | Function pointer to a random number generation function. |
pRngFunArg | Input data into the random number generation function pointer. |
pInput | The input data to process. Must be the same length as the RSA modulus. |
inputLen | The input data length. |
ppOutput | The output buffer. This buffer will be allocated by this function and must be freed by the caller using MOC_FREE. |
ppVlongQueue | Optional vlong queue. |
keyType | The key type, must be akt_rsa or akt_tap_rsa. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_applyPublicKeyAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
ubyte * | pInput, | ||
ubyte4 | inputLen, | ||
ubyte ** | ppOutput, | ||
vlong ** | ppVlongQueue | ||
) |
The input data must be the same length as the RSA modulus. The output buffer will be allocated by this function and must be freed by the caller.
pKey | The key used to perform the operation. This must contain RSA public key data. |
pInput | The input data to process. Must be the same length as the RSA modulus. |
inputLen | The input data length. |
ppOutput | The output buffer. This buffer will be allocated by this function and must be freed by the caller using MOC_FREE. |
ppVlongQueue | Optional vlong queue. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_byteStringFromKey | ( | MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey * | pKey, |
ubyte * | pBuffer, | ||
ubyte4 * | pRetLen | ||
) |
pKey | Pointer to RSAKey that will be used to get byte string. |
pBuffer | Pointer to buffer where byte string will be stored. |
keySize | ubyte4 containing size of key |
ppVlongQueue | Double Pointer to the vlong. |
OK
(0) if sucessful; otherwise a negative number error code defintion from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_cloneKey | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey ** | ppNewKey, |
const RSAKey * | pSrc, | ||
vlong ** | ppVlongQueue | ||
) |
ppNewKey | Double pointer to cloned RSAKey. |
pSrc | Pointer RSAKey that will be cloned. |
ppVlongQueue | Double Pointer to the vlong. |
OK
(0) if sucessful; otherwise a negative number error code defintion from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_createKey | ( | void ** | ppNewKey, |
ubyte4 | keyType, | ||
void * | pKeyAttributes | ||
) |
This will allocate the RSA key shell. The caller is responsible for freeing the memory by calling RSA_freeKey.
ppNewKey | Pointer to the location that will recieve the new key. |
keyType | The key type, must be akt_rsa. |
pKeyAttributes | Pointer to a key attribute structure. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_createKeyAux | ( | RSAKey ** | ppNewKey | ) |
This will allocate the RSA key shell. The caller is responsible for freeing the memory by calling CRYPTO_INTERFACE_RSA_freeKeyAux.
ppNewKey | Pointer to the location that will recieve the new key. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_decryptAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey * | pKey, |
const ubyte * | pCipherText, | ||
ubyte * | pPlainText, | ||
ubyte4 * | pPlainTextLen, | ||
RNGFun | rngFun, | ||
void * | pRngFunArg, | ||
vlong ** | ppVlongQueue | ||
) |
This function decrypts given cipher text using RSA decryption. It supports TAP Key and SW key for doing RSA decryption.
pRSAKey | Pointer to RSAKey. It could be MocAsymkey or RSAKey. |
pCipherText | Pointer to the cipher text. |
pPlainText | Pointer to the plain text to be signed. |
pPlainTextLen | Pointer to the length of the plain text. |
rngFun | Random function pointer. |
rngFunArg | Argument to the random function. |
ppVlongQueue | Double Pointer to the vlong. |
OK
(0) if sucessful; otherwise a negative number error code defintion from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_encryptAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey * | pKey, |
const ubyte * | pPlainText, | ||
ubyte4 | plainTextLen, | ||
ubyte * | pCipherText, | ||
RNGFun | rngFun, | ||
void * | pRngFunArg, | ||
vlong ** | ppVlongQueue | ||
) |
This function creates RSA encryption of the given input buffer. It supports TAP Key and SW key for calculating RSA encryption.
pKey | Pointer to RSAKey. It could be MocAsymkey or RSAKey. |
pPlainText | Pointer to the plain text to be signed. |
plainTextLen | Pointer to the length of the plain text. |
pCipherText | Pointer to the cipher text. |
rngFun | Random function pointer. |
pRngFunArg | Argument to the random function. |
ppVlongQueue | Double Pointer to the vlong. |
OK
(0) if sucessful; otherwise a negative number error code defintion from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_equalKey | ( | MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey * | pKey1, |
const RSAKey * | pKey2, | ||
byteBoolean * | pRes | ||
) |
pKey1 | Pointer to an RSAKey that will be compared. |
pKey2 | Pointer to other RSAKey that will be compared. |
pRes | Pointer to result of comparison. |
OK
(0) if sucessful; otherwise a negative number error code defintion from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_freeKeyAux | ( | RSAKey ** | ppRsaKey, |
vlong ** | ppVlongQueue | ||
) |
ppRsaKey | Double pointer to the key to be deleted. |
ppVlongQueue | Optional vlong queue. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_freeKeyTemplateAux | ( | RSAKey * | pKey, |
MRsaKeyTemplate * | pTemplate | ||
) |
pKey | The key used to delete the key template. This key is not always required. |
pTemplate | Template to free. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_generateKey | ( | MOC_RSA(hwAccelDescr hwAccelCtx) randomContext * | pRandomContext, |
RSAKey * | pRsaKey, | ||
ubyte4 | keySize, | ||
vlong ** | ppVlongQueue | ||
) |
pRandomContext | Pointer to random context used for entropy. |
pRsaKey | Pointer to an RSAKey object. |
keySize | ubyte4 containing size of key. |
ppVlongQueue | Double Pointer to the vlong. |
OK
(0) if sucessful; otherwise a negative number error code defintion from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_getCipherTextLengthAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey * | pKey, |
sbyte4 * | pCipherTextLen | ||
) |
pKey | Pointer to the key used in signing |
pCipherTextLen | Pointer to length of cipher text |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_getKeyBitLen | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
ubyte4 * | pBitLen | ||
) |
pKey | The RSA key in question. |
pBitLen | Contents will be set to the key's bitlength |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_getKeyParametersAllocAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
MRsaKeyTemplate * | pTemplate, | ||
ubyte | keyType | ||
) |
Determine whether two RSA keys are equal.
The caller must provide an allocated MRsaKeyTemplate structure, which will then have its internal pointers allocated by this function. Note it is the callers responsibility to free this memory using RSA_freeKeyTemplate. The reqType should be either MOC_GET_PUBLIC_KEY_DATA or MOC_GET_PRIVATE_KEY_DATA. Tha latter option will get both the private and public key parameters. and as such can only be used with a private key. Retrieving the public data from a private key is allowed, retrieving the private data from a public key is impossible and will result in an error. See the documentation for MRsaKeyTemplate in capasym.h for more info on the format of template data.
pKey | The key to retrieve data from. |
pTemplate | Pointer to an exisiting MRsaKeyTemplate structure. The internal pointers within structure will be allocated by this function. |
keyType | Type of data to retrieve. This must be MOC_GET_PUBLIC_KEY_DATA or MOC_GET_PRIVATE_KEY_DATA. |
OK
(0) if successful, otherwise a negative number error code from merrors.hpKey1 | Pointer to an RSAKey that will be compared. |
pKey2 | Pointer to other RSAKey that will be compared. |
pRes | Pointer to result of comparison. |
OK
(0) if sucessful; otherwise a negative number error code defintion from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_keyFromByteString | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey ** | ppKey, |
const ubyte * | pByteString, | ||
ubyte4 | len, | ||
vlong ** | ppVlongQueue | ||
) |
ppKey | Pointer to an RSAKey pointer that will store newly created object. |
pByteString | Pointer to buffer storing key bytes |
len | Length of pByteString |
ppVlongQueue | Double Pointer to the vlong. |
OK
(0) if sucessful; otherwise a negative number error code defintion from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_pkcs15Pad | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
ubyte4 | operation, | ||
RNGFun | rngFun, | ||
void * | pRngFunArg, | ||
ubyte * | pM, | ||
ubyte4 | mLen, | ||
ubyte ** | ppRetPaddedMsg, | ||
ubyte4 * | pRetPaddedMsgLen | ||
) |
pKey | The RSA key to use for this operation. |
operation | PKCS 1.5 includes a block type byte used to denote the type of operation being performed. This must be MOC_ASYM_KEY_FUNCTION_SIGN for signing. |
rngFun | The RNG function pointer used to generated random bytes. |
rngFunArg | The RNG function pointer argument. |
pM | The plaintext message to be padded. |
mLen | Length in bytes of the input message to be padded. |
ppRetPaddedMsg | Pointer to the pointer which will be allocated by this function and which will recieve the resulting PKCS 1.5 encoded message. |
pRetPaddedMsgLen | Pointer to the location that will recieve the byte length of the resulting PKCS 1.5 encoded message. |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_setAllKeyDataAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
ubyte * | pPubExpo, | ||
ubyte4 | pubExpoLen, | ||
const ubyte * | pModulus, | ||
ubyte4 | modulusLen, | ||
const ubyte * | pPrime1, | ||
ubyte4 | prime1Len, | ||
const ubyte * | pPrime2, | ||
ubyte4 | prime2Len, | ||
vlong ** | ppVlongQueue | ||
) |
The caller must provide the RSA exponent, RSA modulus, RSA prime, and RSA subprime values.
pKey | The key object to set. |
pPubExpo | The RSA exponent as a byte string. |
pubExpoLen | The RSA exponent length. |
pModulus | The RSA modulus as a byte string. |
modulusLen | The RSA modulus length. |
pPrime1 | The RSA prime as a byte string. |
prime1Len | The RSA prime length. |
pPrime2 | The RSA subprime as a byte string. |
prime2Len | The RSA subprime length. |
ppVlongQueue | Optional vlong queue. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_setAllKeyParameters | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
ubyte4 | exponent, | ||
const ubyte * | modulus, | ||
ubyte4 | modulusLen, | ||
const ubyte * | prime1, | ||
ubyte4 | prime1Len, | ||
const ubyte * | prime2, | ||
ubyte4 | prime2Len, | ||
vlong ** | ppVlongQueue | ||
) |
The caller must provide the RSA exponent, RSA modulus, RSA prime, and RSA subprime values.
pKey | The key object to set. |
exponent | The RSA exponent as 4 byte integer. |
pModulus | The RSA modulus as a byte string. |
modulusLen | The RSA modulus length. |
pPrime1 | The RSA prime as a byte string. |
prime1Len | The RSA prime length. |
pPrime2 | The RSA subprime as a byte string. |
prime2Len | The RSA subprime length. |
ppVlongQueue | Optional vlong queue. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_setPublicKeyData | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
ubyte * | pPubExpo, | ||
ubyte4 | pubExpoLen, | ||
const ubyte * | pModulus, | ||
ubyte4 | modulusLen, | ||
vlong ** | ppVlongQueue | ||
) |
The caller must provide the RSA exponent as a ubyte4 and the RSA modulus as a byte string.
pKey | The key object to be set. |
pPubExpo | Pointer to buffer containing exponent |
pubExpoLen | The RSA exponent length. |
pModulus | The RSA modulus as a byte string. |
modulusLen | The length of the RSA modulus. |
ppVlongQueue | Optional vlong queue. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_setPublicKeyParametersAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
ubyte4 | exponent, | ||
const ubyte * | pModulus, | ||
ubyte4 | modulusLen, | ||
vlong ** | ppVlongQueue | ||
) |
The caller must provide the RSA exponent as a ubyte4 and the RSA modulus as a byte string.
pKey | The key object to be set. |
exponent | The RSA exponent. |
pModulus | The RSA modulus as a byte string. |
modulusLen | The length of the RSA modulus. |
ppVlongQueue | Optional vlong queue. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_signMessageAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey * | pKey, |
const ubyte * | pPlainText, | ||
ubyte4 | plainTextLen, | ||
ubyte * | pCipherText, | ||
vlong ** | ppVlongQueue | ||
) |
pKey | Pointer to the key used in signing |
pPlainText | Pointer to plain text buffer |
plainTextLen | size of plain text buffer |
pCipherText | Pointer to buffer for cipher text |
ppVlongQueue | Optional vlong queue. |
OK
(0) if successful, otherwise a negative number error code from merrors.h MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_verifyDigest | ( | MOC_RSA(hwAccelDescr hwAccelCtx) RSAKey * | pKey, |
ubyte * | pMsgDigest, | ||
ubyte4 | digestLen, | ||
ubyte * | pSignature, | ||
ubyte4 | sigLen, | ||
intBoolean * | pIsValid, | ||
vlong ** | ppVlongQueue | ||
) |
This function verifies the digest of a message, using the provided RSA public key.
[in] | hwAccelCtx | (Reserved for future use.) |
[in] | pKey | Pointer to RSA public key. |
[in] | pMsgDigest | Pointer to Msg Digest to be verified. |
[in] | digestLen | The length of the message digest in bytes. |
[in] | pSignature | Pointer to the signature to be verified. |
[in] | sigLen | The length of the signature in bytes. |
[out] | pIsValid | Contents will be set with TRUE if the signature is valid and FALSE if otherwise. |
[out] | ppVlongQueue | On return, pointer to location in the vlong queue that contains this function's intermediate value, which can subsequently be used and eventually discarded. (Before ending, your application should be sure to free the entire queue.) |
OK
(0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR
macro.OK
and a pIsValid
of TRUE
before accepting that a signature is valid. MOC_EXTERN MSTATUS CRYPTO_INTERFACE_RSA_verifySignatureAux | ( | MOC_RSA(hwAccelDescr hwAccelCtx) const RSAKey * | pKey, |
const ubyte * | pCipherText, | ||
ubyte * | pPlainText, | ||
ubyte4 * | pPlainTextLen, | ||
vlong ** | ppVlongQueue | ||
) |
pKey | Pointer to the key used in signing |
pCipherText | Pointer to buffer for cipher text |
pPlainText | Pointer to plain text buffer |
plainTextLen | Pointer to number of bytes written to pPlainText |
ppVlongQueue | Optional vlong queue. |
OK
(0) if successful, otherwise a negative number error code from merrors.h