Static ReadonlyKEY_The byte length of a ECPublicKey.
A copy of the bytes; mutating it does not touch this value.
StaticfromRestore an ECPublicKey from a fixed-size array of bytes.
StaticfromGet hex string representation.
Get base64 representation.
Returns the compressed public key (self).
This method implements the ECKey interface. Since ECPublicKey is already a compressed public key, this returns itself.
Convert this compressed public key to uncompressed format.
Verify an ECDSA signature. A key that does not decode, or a signature
whose r or s is not below the curve order, is an InvalidData failure
(the reference's ecdsa_verify panics on them); any other pair is
true or false.
The reference: the digest of the tagged CBOR, as the reference computes it.
The first four bytes of reference() in hex, the reference's ref_hex_short.
The reference's Display: the type name over the short reference.
The CBOR tags of this type; the first one is used to encode. As the
reference, this type is only encoded: it has no fromCbor.
Returns the untagged CBOR encoding.
Format: { 3: h'<33-byte-key>' } Note: No key 2 indicates this is a public key
The tagged CBOR form.
As a UR, typed by the first tag's name.
EC compressed public key for ECDSA verification (secp256k1, 33 bytes)
An
ECPublicKeyis a 33-byte compressed representation of a public key on the secp256k1 curve. The first byte is a prefix (0x02 or 0x03) that indicates the parity of the y-coordinate, followed by the 32-byte x-coordinate.These public keys are used to:
CBOR Serialization
ECPublicKeyis serialized to CBOR with tags 40306 (or legacy 306).The format is a map: