![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Functions | |
MOC_EXTERN MSTATUS | SSHC_freeGenerateServerAuthKeyFile (ubyte **ppFreeEncodedAuthKey) |
Release an authentication key's memory. More... | |
MOC_EXTERN MSTATUS | SSHC_generateServerAuthKeyFile (ubyte *pKeyBlob, ubyte4 keyBlobLen, ubyte **ppRetEncodedAuthKey, ubyte4 *pRetEncodedAuthKeyLen) |
Generate an exportable public key for an internal public key BLOB. More... | |
MOC_EXTERN MSTATUS | SSHC_parsePublicKeyBuffer (ubyte *pKeyFile, ubyte4 keyFileLen, AsymmetricKey *pAsymKey) |
Parses an public key and generates an AsymmetricKey object. More... | |
MOC_EXTERN MSTATUS | SSHC_parseServerAuthKeyFile (ubyte *pKeyFile, ubyte4 keyFileLen, AsymmetricKey *pAsymKey) |
Parses an exportable public key and generates an AsymmetricKey object. More... | |
MOC_EXTERN MSTATUS SSHC_freeGenerateServerAuthKeyFile | ( | ubyte ** | ppFreeEncodedAuthKey | ) |
This function releases the memory used to store the specified authentication key.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
ppFreeEncodedAuthKey | Pointer to address of buffer containing the NULL-terminated authentication key string. |
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 SSHC_generateServerAuthKeyFile | ( | ubyte * | pKeyBlob, |
ubyte4 | keyBlobLen, | ||
ubyte ** | ppRetEncodedAuthKey, | ||
ubyte4 * | pRetEncodedAuthKeyLen | ||
) |
This function generates an exportable public key from the specified internal public key BLOB. For exportable public key format, see the IETF Internet-Draft for SSH Public Key File Format: http://tools.ietf.org/html/draft-ietf-secsh-publickeyfile-13.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
pKeyBlob | Pointer to key blob. |
keyBlobLen | Number of bytes in the key blob (pKeyBlob ). |
ppRetEncodedAuthKey | Pointer to address of encoded authentication key, which on return contains the user's public key. |
pRetEncodedAuthKeyLen | Pointer to ubyte4, which on return contains the number of bytes in the user's public key (ppRetEncodedAuthKey ). |
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 SSHC_parsePublicKeyBuffer | ( | ubyte * | pKeyFile, |
ubyte4 | keyFileLen, | ||
AsymmetricKey * | pAsymKey | ||
) |
This function takes a public key and generates a AsymmetricKey object. For public key formats, see: https://tools.ietf.org/html/rfc4253#section-6.6 for rsa and dsa. https://tools.ietf.org/html/rfc5656#section-3.1 for ecdsa https://tools.ietf.org/html/draft-ietf-curdle-ssh-ed25519-02 for ed25519
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
pKeyBlob | Pointer to buffer containing public key. |
keyBlobLen | Number of bytes in key buffer (pKeyBlob ). |
pAsymKey | Pointer to an AsymmetricKey object into which the key will be placed. |
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 SSHC_parseServerAuthKeyFile | ( | ubyte * | pKeyFile, |
ubyte4 | keyFileLen, | ||
AsymmetricKey * | pAsymKey | ||
) |
This function takes a exportable public key file and generates a AsymmetricKey object. Format of file is algorithm identifier, followed by a white space, followed by the base64 encoded public key.
To enable this function, the following flag must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__
pKeyFile | Pointer to buffer containing an SSH key file. |
keyFileLen | Number of bytes in key file buffer (pKeyFile ). |
pAsymKey | Pointer to an AsymmetricKey object into which the key will be placed. |
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.