Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyPair ¶
func GenerateKeyPair( curveInstance elliptic.Curve, ) (*PrivateKey, *PublicKey, error)
GenerateKeyPair generates an operator key pair using the provided elliptic curve instance. The provided curve instance's name must resolve to one of the supported curves determined by the operator.Curve enum.
func MarshalCompressed ¶ added in v1.21.0
MarshalCompressed marshals the given public key to the 33-byte compressed form. This implementation is based on the elliptic.MarshalCompressed function.
func MarshalUncompressed ¶ added in v1.21.0
MarshalUncompressed marshals the given public key to the 65-byte uncompressed form. This implementation is based on the elliptic.Marshal function.
Types ¶
type Curve ¶ added in v1.21.0
type Curve int
Curve represents an elliptic curve name that denotes the curve used by the operator keys.
Enum that lists all the elliptic curves that can be used with the operator keys.
func ParseCurve ¶ added in v1.21.0
ParseCurve takes a curve name as string and parses it to a specific operator.Curve enum instance.
type PrivateKey ¶
PrivateKey represents an operator private key corresponding to an operator public key.
type PublicKey ¶
PublicKey represents a public key that identifies the node operator. Actually this is an ECDSA public key that is not tied to any particular elliptic curve implementation and holds just the curve name instead. That trait makes the operator key flexible enough to be accepted by chain and network packages that can convert it to the chain and network key respectively. Chain and network keys should use their own implementations of the curve held by the operator key.