![]() |
TrustCore SDK NanoCrypto API reference
version 7.0
|
Header file for Digicert SSH key utilities API. More...
Go to the source code of this file.
Functions | |
MOC_EXTERN MSTATUS | KEY_UTILS_CreateKeyBlobFromPEM (MOC_DSA(hwAccelDescr hwAccelCtx) ubyte *passphrase, ubyte *pPrivKey, ubyte4 privKeyLength, ubyte **pRetKeyBlob, ubyte4 *pRetKeyBlobLength, ubyte4 *retVal) |
Create a keyblob from a PEM-encoded private key. More... | |
MOC_EXTERN void | KEY_UTILS_PEMKeyIsEncrypted (ubyte *pPrivKey, ubyte4 privKeyLength, ubyte4 *retVal) |
Determine whether a PEM key is encrypted. More... | |
MOC_EXTERN MSTATUS | KEY_UTILS_PEMKeyIsValid (MOC_ASYM(hwAccelDescr hwAccelCtx) ubyte *passphrase, ubyte *pPrivKey, ubyte4 privKeyLength, ubyte4 *retVal) |
Determine whether a PEM-encoded private key is valid. More... | |
Header file for Digicert SSH key utilities API.
The following flags are required to enable this file's functions:
__ENABLE_MOCANA_KEY_UTILS__
__ENABLE_MOCANA_DSA__
MOC_EXTERN MSTATUS KEY_UTILS_CreateKeyBlobFromPEM | ( | MOC_DSA(hwAccelDescr hwAccelCtx) ubyte * | passphrase, |
ubyte * | pPrivKey, | ||
ubyte4 | privKeyLength, | ||
ubyte ** | pRetKeyBlob, | ||
ubyte4 * | pRetKeyBlobLength, | ||
ubyte4 * | retVal | ||
) |
This function checks a passphrase to determine if a password exists. If a password exists, this function decodes the key and converts it to a keyblob. If the passphrase is NULL, this function tries to convert the private key as-is.
To enable this function, the following flag must be defined:
__ENABLE_MOCANA_KEY_UTILS__
passphrase | Password for decrypting the private key. |
pPrivKey | Private key to be convert to keyblob. |
privKeyLength | Length of the private key, pPrivKey . |
pRetKeyBlob | On return, pointer to resultant keyblob. |
pRetKeyBlobLength | On return, length of resultant keyblob, pRetKeyBlob . |
retVal | On return, "1" if the key is converted; otherwise "0". |
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.MOC_EXTERN void KEY_UTILS_PEMKeyIsEncrypted | ( | ubyte * | pPrivKey, |
ubyte4 | privKeyLength, | ||
ubyte4 * | retVal | ||
) |
This function searches the entire private key to determine whether it contains the word "ENCRYPTED".
To enable this function, the following flag must be defined:
__ENABLE_MOCANA_KEY_UTILS__
pPrivKey | Private key to examine. |
privKeyLength | Length of the private key, pPrivKey . |
retVal | On return, "1" if the key is encrypted; otherwise "0". |
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.MOC_EXTERN MSTATUS KEY_UTILS_PEMKeyIsValid | ( | MOC_ASYM(hwAccelDescr hwAccelCtx) ubyte * | passphrase, |
ubyte * | pPrivKey, | ||
ubyte4 | privKeyLength, | ||
ubyte4 * | retVal | ||
) |
Determine whether a PEM-encoded private key is valid.
retVal
is "1". Otherwise the key is not valid.To enable this function, the following flag must be defined:
__ENABLE_MOCANA_KEY_UTILS__
passphrase | Password for decrypting the private key. |
pPrivKey | Private key to validate. |
privKeyLength | Length of the private key, pPrivKey . |
retVal | On return, "1" if the key is valid; otherwise "0". |
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.