SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
SharkSslPSAConsumerEdDSA.h
Go to the documentation of this file.
1
37#ifndef SHARKSSL_PSA_CONSUMER_EDDSA_H
38#define SHARKSSL_PSA_CONSUMER_EDDSA_H
39
40#include "SharkSSL.h"
41
42#if !SHARKSSL_PSA_CONSUMER
43#error SharkSslPSAConsumerEdDSA.h requires SHARKSSL_PSA_CONSUMER
44#endif
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
55typedef struct SharkSslPSAEdDSAKey
56{
58 U16 bits;
62
63SHARKSSL_API int SharkSslPSAEdDSAKey_generate(SharkSslPSAEdDSAKey *o, U16 bits, int prehash);
64SHARKSSL_API int SharkSslPSAEdDSAKey_importPrivate(SharkSslPSAEdDSAKey *o, const U8 *seed,
65 U16 seedLen, U16 bits, int prehash);
66SHARKSSL_API int SharkSslPSAEdDSAKey_importPublic(SharkSslPSAEdDSAKey *o, const U8 *publicKey,
67 U16 publicKeyLen, U16 bits, int prehash);
68SHARKSSL_API int SharkSslPSAEdDSAKey_exportPublic(const SharkSslPSAEdDSAKey *o, U8 *publicKey,
69 U16 publicKeySize, U16 *publicKeyLen);
70SHARKSSL_API int SharkSslPSAEdDSAKey_sign(const SharkSslPSAEdDSAKey *o, const U8 *message,
71 U32 messageLen, U8 *signature, U16 signatureSize,
72 U16 *signatureLen);
73SHARKSSL_API int SharkSslPSAEdDSAKey_verify(const SharkSslPSAEdDSAKey *o, const U8 *message,
74 U32 messageLen, const U8 *signature, U16 signatureLen);
75#if (SHARKSSL_ENABLE_CSR_CREATION && SHARKSSL_ENABLE_EDDSA)
81 const SharkSslPSAEdDSAKey *key,
82 struct SharkSslCertDN *certDN,
83 const char *SAN,
84 struct SharkSslBitExtReq *keyUsage,
85 struct SharkSslBitExtReq *nsCertType);
86#endif
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif
TLS objects, certificate/session operations, and public-key interfaces.
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...
struct SharkSslPSAEdDSAKey SharkSslPSAEdDSAKey
A volatile PSA Ed25519 or Ed448 key.
uint32_t psa_key_id_t
Definition: crypto.h:60
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.
SHARKSSL_API int SharkSslPSAEdDSAKey_destructor(SharkSslPSAEdDSAKey *o)
Destroy the owned volatile PSA key and clear the context.
SHARKSSL_API int SharkSslPSAEdDSAKey_exportPublic(const SharkSslPSAEdDSAKey *o, U8 *publicKey, U16 publicKeySize, U16 *publicKeyLen)
Export the public key without transferring handle ownership.
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.
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.
SHARKSSL_API int SharkSslPSAEdDSAKey_generate(SharkSslPSAEdDSAKey *o, U16 bits, int prehash)
Generate a volatile private key through the selected PSA provider.
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.
Opaque object used when creating ASN.1 encoded data.
Definition: SharkSslASN1.h:255
Requested one-byte extension bit mask for CSR creation.
Definition: SharkSslASN1.h:268
Certificate KeyUsage and ExtendedKeyUsage flags and relative pseudofunctions.
Definition: SharkSSL.h:738
A volatile PSA Ed25519 or Ed448 key.
Definition: SharkSslPSAConsumerEdDSA.h:56
U8 publicOnly
Definition: SharkSslPSAConsumerEdDSA.h:60
U16 bits
Definition: SharkSslPSAConsumerEdDSA.h:58
U8 prehash
Definition: SharkSslPSAConsumerEdDSA.h:59
psa_key_id_t handle
Definition: SharkSslPSAConsumerEdDSA.h:57