SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
SharkSslPSAConsumerEdDSA.h File Reference
#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)
 
SHARKSSL_API int SharkSslPSAEdDSAKey_importPrivate (SharkSslPSAEdDSAKey *o, const U8 *seed, U16 seedLen, U16 bits, int prehash)
 
SHARKSSL_API int SharkSslPSAEdDSAKey_importPublic (SharkSslPSAEdDSAKey *o, const U8 *publicKey, U16 publicKeyLen, U16 bits, int prehash)
 
SHARKSSL_API int SharkSslPSAEdDSAKey_exportPublic (const SharkSslPSAEdDSAKey *o, U8 *publicKey, U16 publicKeySize, U16 *publicKeyLen)
 
SHARKSSL_API int SharkSslPSAEdDSAKey_sign (const SharkSslPSAEdDSAKey *o, const U8 *message, U32 messageLen, U8 *signature, U16 signatureSize, U16 *signatureLen)
 
SHARKSSL_API int SharkSslPSAEdDSAKey_verify (const SharkSslPSAEdDSAKey *o, const U8 *message, U32 messageLen, const U8 *signature, U16 signatureLen)
 
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)
 

Detailed Description

See Choose a SharkSSL API for build scope and the owning API layer.

Typedef Documentation

◆ 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.

Function Documentation

◆ SharkSslASN1Create_CSRWithPSAEdDSAKey()

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.

Parameters
oSharkSslASN1Create *; required freshly initialized writer with an empty caller-owned buffer (ptr=end). Retrieve the resulting DER with SharkSslASN1Create_getDataLen.
keyconst SharkSslPSAEdDSAKey *; required live private signing-key context, borrowed for the call; public-only keys are rejected.
certDNSharkSslCertDN *; required subject distinguished name, borrowed for the call.
SANconst char *; optional NUL-terminated SAN string using SharkSslASN1Create_CSR syntax; NULL omits this extension.
keyUsageSharkSslBitExtReq *; optional requested key-usage extension, or NULL.
nsCertTypeSharkSslBitExtReq *; optional Netscape certificate-type extension, or NULL.
Returns
int: 0 on success; nonzero on invalid input, insufficient writer space, allocation/signing failure, or unsupported key/hash. Discard the writer output after failure.

◆ SharkSslPSAEdDSAKey_destructor()

SHARKSSL_API int SharkSslPSAEdDSAKey_destructor ( SharkSslPSAEdDSAKey *  o)

◆ SharkSslPSAEdDSAKey_exportPublic()

SHARKSSL_API int SharkSslPSAEdDSAKey_exportPublic ( const SharkSslPSAEdDSAKey *  o,
U8 *  publicKey,
U16  publicKeySize,
U16 *  publicKeyLen 
)

◆ SharkSslPSAEdDSAKey_generate()

SHARKSSL_API int SharkSslPSAEdDSAKey_generate ( SharkSslPSAEdDSAKey *  o,
U16  bits,
int  prehash 
)

◆ SharkSslPSAEdDSAKey_importPrivate()

SHARKSSL_API int SharkSslPSAEdDSAKey_importPrivate ( SharkSslPSAEdDSAKey *  o,
const U8 *  seed,
U16  seedLen,
U16  bits,
int  prehash 
)

◆ SharkSslPSAEdDSAKey_importPublic()

SHARKSSL_API int SharkSslPSAEdDSAKey_importPublic ( SharkSslPSAEdDSAKey *  o,
const U8 *  publicKey,
U16  publicKeyLen,
U16  bits,
int  prehash 
)

◆ SharkSslPSAEdDSAKey_sign()

SHARKSSL_API int SharkSslPSAEdDSAKey_sign ( const SharkSslPSAEdDSAKey *  o,
const U8 *  message,
U32  messageLen,
U8 *  signature,
U16  signatureSize,
U16 *  signatureLen 
)

◆ SharkSslPSAEdDSAKey_verify()

SHARKSSL_API int SharkSslPSAEdDSAKey_verify ( const SharkSslPSAEdDSAKey *  o,
const U8 *  message,
U32  messageLen,
const U8 *  signature,
U16  signatureLen 
)