scclib
Stable Cloud Computing C++ Library
Static Public Member Functions | List of all members
scc::crypto::EcPublicKeyCert Struct Reference

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 > &)
 

Detailed Description

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.

Definition at line 247 of file cert.h.

Member Function Documentation

◆ dump()

void EcPublicKeyCert::dump ( const EccGfpPoint pub,
std::vector< char > &  v 
)
static

Dump to memory.

Dumps the point directly to the vector. Vector is resized.

Definition at line 399 of file cert.cc.

◆ parse()

void EcPublicKeyCert::parse ( const BasePtr &  b,
const KeyAlgoType algo,
EccGfpPoint pub 
)
static

Parse from a bit string for a specific curve.

Throws exception if string is compressed, or is an invalid point for the curve.

The KeyAlgoType type must be one of the ecdsa types.

Definition at line 366 of file cert.cc.


The documentation for this struct was generated from the following files: