scclib
Stable Cloud Computing C++ Library
|
Elliptic curve public key. More...
#include <cert.h>
Static Public Member Functions | |
static void | parse (const BasePtr &, const KeyAlgoType &, EccGfpPoint &) |
Parse from a bit string for a specific curve. More... | |
static void | parse (const DerDocument &doc, const KeyAlgoType &alg, EccGfpPoint &p) |
static void | parse (const void *, int, const KeyAlgoType &, EccGfpPoint &) |
Parse from memory. | |
static void | parse (const std::vector< char > &v, const KeyAlgoType &a, EccGfpPoint &p) |
static void | parse (const std::vector< uint8_t > &v, const KeyAlgoType &a, EccGfpPoint &p) |
static BasePtr | dump (const EccGfpPoint &) |
Dump to an uncompressed bit string. | |
static void | dump (const EccGfpPoint &, std::vector< char > &) |
Dump to memory. More... | |
static void | dump (const EccGfpPoint &, std::vector< uint8_t > &) |
Elliptic curve public key.
From: https://tools.ietf.org/html/rfc5480#section-2.2
The elliptic curve public key (a value of type ECPoint that is an OCTET STRING) is mapped to a subjectPublicKey (a value of type BIT STRING) as follows: the most significant bit of the OCTET STRING value becomes the most significant bit of the BIT STRING value, and so on; the least significant bit of the OCTET STRING becomes the least significant bit of the BIT STRING. Conversion routines are found in Sections 2.3.1 and 2.3.2 of [SEC1].
The first octet of the OCTET STRING indicates whether the key is compressed or uncompressed. The uncompressed form is indicated by 0x04 and the compressed form is indicated by either 0x02 or 0x03 (see 2.3.3 in [SEC1]). The public key MUST be rejected if any other value is included in the first octet.
This implementation assumes that the key is uncompressed.
|
static |
|
static |