# CSR signature using elliptic curve [closed]

We've been asked to generate a certificate signing request using elliptic curve and we can't use any third-party library as it's an embedded application with very limited resources).

We are used to generating CSR using RSA, but we can't find any documentation on how to do that with an elliptic curve; specifically, which data to use for the signing part. Studying OpenSSL-generated CSR it looks like there are multiple signatures generated, or a hash of some kind, but we don't know. And OpenSSL source code is quite difficult to read when you're not used to it.

Can anyone point us in the right direction?

• A PKCS10 CSR definitely contains exactly one signature in all cases, and OpenSSL correctly does that in all cases. ECDSA signing does involve a hash internally but it is not visible in the signature, and exactly the same is true for RSA. Maybe you could be more specific about what is confusing you. Do you have an implementation of ECDSA, or more generally ECC? If not, doing it 'from scratch' is going to be a fair bit of work. If you can do RSA, presumably you at least have multiprecision aka bignum arithmetic. – dave_thompson_085 Jul 25 '19 at 8:08

• The signature algorithm should be the right OID (e.g. ecdsaWithSHA256)
• The public key value must a SubjectPublicKeyInfo structure with values specified in RFC5480: the algorithm field is an AlgorithmIdentifier whose algorithm field is the OID id-ecPublicKey and whose parameters field is the OID of the curve used. Finally, the subjectPublicKey field in SubjectPublicKeyInfo is the public key encoded as specified by SEC section 2.3.3.