37#ifndef SHARKSSL_PSA_CONSUMER_ECDSA_H
38#define SHARKSSL_PSA_CONSUMER_ECDSA_H
43#if !SHARKSSL_PSA_CONSUMER
44#error SharkSslPSAConsumerECDSA.h requires SHARKSSL_PSA_CONSUMER
69 const U8 *privateKey, U16 privateKeyLen);
72 const U8 *publicKey, U16 publicKeyLen);
74 U8 *publicKey, U16 publicKeySize, U16 *publicKeyLen);
76 const U8 *hash, U16 hashLen,
77 U8 *signature, U16 signatureSize, U16 *signatureLen);
79 const U8 *hash, U16 hashLen,
80 const U8 *signature, U16 signatureLen);
82 U8 *der, U16 derSize, U16 *derLen);
84 U8 *raw, U16 rawSize, U16 *rawLen);
85#if SHARKSSL_ENABLE_CSR_CREATION
TLS objects, certificate/session operations, and public-key interfaces.
See Choose a SharkSSL API for build scope and the owning API layer.
SHARKSSL_API int SharkSslASN1Create_CSRWithPSAECDSAKey(struct SharkSslASN1Create *o, const SharkSslPSAEcdsaKey *key, struct SharkSslCertDN *certDN, const char *SAN, struct SharkSslBitExtReq *keyUsage, struct SharkSslBitExtReq *nsCertType)
Create a PKCS#10 CSR using a private P-256, P-384, or P-521 PSA handle The handle must permit ECDSA s...
struct SharkSslPSAEcdsaKey SharkSslPSAEcdsaKey
A volatile PSA key owned by this context Initialize once, then destroy before reusing it Signatures a...
SHARKSSL_API int SharkSslASN1Create_CSRWithPSAECDSAKeyHash(struct SharkSslASN1Create *o, const SharkSslPSAEcdsaKey *key, struct SharkSslCertDN *certDN, const char *SAN, struct SharkSslBitExtReq *keyUsage, struct SharkSslBitExtReq *nsCertType, U8 hashID)
Select a concrete digest when the signing key permits ECDSA(ANY_HASH).
uint32_t psa_key_id_t
Definition: crypto.h:60
uint32_t psa_algorithm_t
Definition: crypto.h:58
SHARKSSL_API int SharkSslPSAEcdsaKey_destructor(SharkSslPSAEcdsaKey *o)
Destroy the owned volatile PSA key and clear the context.
SHARKSSL_API int SharkSslPSAEcdsaKey_exportPublic(const SharkSslPSAEcdsaKey *o, U8 *publicKey, U16 publicKeySize, U16 *publicKeyLen)
Export the public key without transferring handle ownership.
SHARKSSL_API int SharkSslPSAEcdsaKey_verifyRaw(const SharkSslPSAEcdsaKey *o, const U8 *hash, U16 hashLen, const U8 *signature, U16 signatureLen)
Verify a fixed-width raw ECDSA r||s signature over a digest.
SHARKSSL_API int SharkSslPSAEcdsaKey_signRaw(const SharkSslPSAEcdsaKey *o, const U8 *hash, U16 hashLen, U8 *signature, U16 signatureSize, U16 *signatureLen)
Sign a digest and return fixed-width raw ECDSA r||s.
SHARKSSL_API int SharkSslPSAEcdsaKey_importPrivate(SharkSslPSAEcdsaKey *o, U16 curveID, psa_algorithm_t hashAlg, int deterministic, const U8 *privateKey, U16 privateKeyLen)
Import a private key into an owned volatile PSA handle.
SHARKSSL_API int SharkSslPSAEcdsa_derToRaw(U16 curveID, const U8 *der, U16 derLen, U8 *raw, U16 rawSize, U16 *rawLen)
Convert an ECDSA signature from DER to raw r||s.
SHARKSSL_API int SharkSslPSAEcdsaKey_generate(SharkSslPSAEcdsaKey *o, U16 curveID, psa_algorithm_t hashAlg, int deterministic)
Generate a volatile private key through the selected PSA provider.
SHARKSSL_API int SharkSslPSAEcdsaKey_importPublic(SharkSslPSAEcdsaKey *o, U16 curveID, psa_algorithm_t hashAlg, int deterministic, const U8 *publicKey, U16 publicKeyLen)
Import a public verification/encryption key into a volatile PSA handle.
SHARKSSL_API int SharkSslPSAEcdsa_rawToDer(U16 curveID, const U8 *raw, U16 rawLen, U8 *der, U16 derSize, U16 *derLen)
Convert an ECDSA signature from raw r||s to DER.
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 key owned by this context Initialize once, then destroy before reusing it Signatures a...
Definition: SharkSslPSAConsumerECDSA.h:58
U8 publicOnly
Definition: SharkSslPSAConsumerECDSA.h:62
psa_key_id_t handle
Definition: SharkSslPSAConsumerECDSA.h:59
U16 curveID
Definition: SharkSslPSAConsumerECDSA.h:61
psa_algorithm_t algorithm
Definition: SharkSslPSAConsumerECDSA.h:60