0
$\begingroup$

This is not a programming question. This is to confirm whether a crypto documentation is incorrect.

I am using Rust's p384 crate. I am creating a private key from a JWK string.

In the source code, at line 85:

https://docs.rs/elliptic-curve/latest/src/elliptic_curve/jwk.rs.html#85

it says:

The `d` ECC private key parameter as described in RFC 7518 6.2.2.1:
<https://tools.ietf.org/html/rfc7518#section-6.2.2.1>
Value is optional and if omitted, this JWK represents a private key.

Isn't the last line wrong? It says "if omitted, this JWK represents a private key".

Shouldn't it say "if present, this JWK represents a private key"?

The RFC it links to:

https://datatracker.ietf.org/doc/html/rfc7518#section-6.2.2.1

says:

The "d" (ECC private key) parameter contains the Elliptic Curve private key value.

So, if this d value is omitted (as per the code comments), that wouldn't be a private key from what I understand.

$\endgroup$

1 Answer 1

1
$\begingroup$

I'm fairly confident that it's supposed to be "public key".

$d$ is the typical label for any "scalar" private key - decryption exponent in RSA or scalar factor in ECC. In RSA, public key is colloquially $(n,e)$, while in ECC, it's $Q$.

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.