w
is represented in hex by the hexadecimal encoding of its integer value encoded in octets as per section 3 of
[RFC5915], denoted here as HEX(w)
.
(x,y)
is represented in hex by the hexadecimal encoding of the octet string as defined in section 4.3.6 of
[X9-63]:
04||HEX(x)||HEX(y)
Compressed representation (beginning "02" or "03") is not supported due to patent issues.
Note that the format is different for the safe curves X25519, Ed25519, X448 and Ed448.
An ECDSA signature consists of a pair of integers (r,s)
.
There are two representations of ECDSA signatures used in this toolkit:
r
and s
, in that order (i.e. r||s
)
as specified in section 6.4.1 of [XMLDSIG]
with a length parameter l equal to ceiling(log2(q)/8)
where q
is the order of the curve.
This is the default output in this toolkit.
It is the form expected for a SignatureValue
in an XML-DSIG signature [RFC4050]
and is described in section E3.1 of [IEEE1363].
r
and s
, in that order).
This is the representation used by Bitcoin and in X.509 certificates and is an optional output in this toolkit.
Use the PKI_SIG_ASN1DER option flag.
By default, these representations are formatted in base64 encoding. Use the PKI_ENCODE_BASE64URL option to format the signature in URL-safe "base64url" encoding, or the PKI_ENCODE_HEX option for hexadecimal (base16) encoding.
Yes, as of [v12.0] we do. See, for example, X509_MakeCert
and ECC_ReadPublicKey
.