|
SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
|
#include "SharkSSL.h"Go to the source code of this file.
Data Structures | |
| struct | SharkSslPSAEdDSAKey |
| A volatile PSA Ed25519 or Ed448 key. More... | |
Typedefs | |
| typedef struct SharkSslPSAEdDSAKey | SharkSslPSAEdDSAKey |
| A volatile PSA Ed25519 or Ed448 key. More... | |
Functions | |
| SHARKSSL_API int | SharkSslPSAEdDSAKey_generate (SharkSslPSAEdDSAKey *o, U16 bits, int prehash) |
| Generate a volatile private key through the selected PSA provider. More... | |
| SHARKSSL_API int | SharkSslPSAEdDSAKey_importPrivate (SharkSslPSAEdDSAKey *o, const U8 *seed, U16 seedLen, U16 bits, int prehash) |
| Import a private key into an owned volatile PSA handle. More... | |
| SHARKSSL_API int | SharkSslPSAEdDSAKey_importPublic (SharkSslPSAEdDSAKey *o, const U8 *publicKey, U16 publicKeyLen, U16 bits, int prehash) |
| Import a public verification/encryption key into a volatile PSA handle. More... | |
| SHARKSSL_API int | SharkSslPSAEdDSAKey_exportPublic (const SharkSslPSAEdDSAKey *o, U8 *publicKey, U16 publicKeySize, U16 *publicKeyLen) |
| Export the public key without transferring handle ownership. More... | |
| SHARKSSL_API int | SharkSslPSAEdDSAKey_sign (const SharkSslPSAEdDSAKey *o, const U8 *message, U32 messageLen, U8 *signature, U16 signatureSize, U16 *signatureLen) |
| Sign the original message using the selected EdDSA mode. More... | |
| SHARKSSL_API int | SharkSslPSAEdDSAKey_verify (const SharkSslPSAEdDSAKey *o, const U8 *message, U32 messageLen, const U8 *signature, U16 signatureLen) |
| Verify an EdDSA signature over the original message. More... | |
| SHARKSSL_API int | SharkSslASN1Create_CSRWithPSAEdDSAKey (struct SharkSslASN1Create *o, const SharkSslPSAEdDSAKey *key, struct SharkSslCertDN *certDN, const char *SAN, struct SharkSslBitExtReq *keyUsage, struct SharkSslBitExtReq *nsCertType) |
| Create a PKCS#10 CSR using a private PureEdDSA PSA handle The key must be Ed25519 or Ed448 and permit message signing. More... | |
| SHARKSSL_API int | SharkSslPSAEdDSAKey_destructor (SharkSslPSAEdDSAKey *o) |
| Destroy the owned volatile PSA key and clear the context. More... | |
See Choose a SharkSSL API for build scope and the owning API layer.
| typedef struct SharkSslPSAEdDSAKey SharkSslPSAEdDSAKey |
A volatile PSA Ed25519 or Ed448 key.
PureEdDSA signs the message; HashEdDSA uses SHA-512 for Ed25519ph and SHAKE256-512 for Ed448ph. Signatures are the RFC 8032 raw R||S encoding.
| int SharkSslASN1Create_CSRWithPSAEdDSAKey | ( | struct SharkSslASN1Create * | o, |
| const SharkSslPSAEdDSAKey * | key, | ||
| struct SharkSslCertDN * | certDN, | ||
| const char * | SAN, | ||
| struct SharkSslBitExtReq * | keyUsage, | ||
| struct SharkSslBitExtReq * | nsCertType | ||
| ) |
Create a PKCS#10 CSR using a private PureEdDSA PSA handle The key must be Ed25519 or Ed448 and permit message signing.
This creates a request, not an issued certificate.
Inputs and the private key remain owned by the caller. Requires a PureEdDSA Ed25519 or Ed448 key; prehash keys are rejected.
| o | SharkSslASN1Create *; required freshly initialized writer with an empty caller-owned buffer (ptr=end). Retrieve the resulting DER with SharkSslASN1Create_getDataLen. |
| key | const SharkSslPSAEdDSAKey *; required live private signing-key context, borrowed for the call; public-only keys are rejected. |
| certDN | SharkSslCertDN *; required subject distinguished name, borrowed for the call. |
| SAN | const char *; optional NUL-terminated SAN string using SharkSslASN1Create_CSR syntax; NULL omits this extension. |
| keyUsage | SharkSslBitExtReq *; optional requested key-usage extension, or NULL. |
| nsCertType | SharkSslBitExtReq *; optional Netscape certificate-type extension, or NULL. |