struct

Beryl::Crypto::V1::EllipticCurveP384::PublicKey

Inherits Struct < Value < Object

A public key: a point of the curve other than the point at infinity.

Constructors

new(encoded : Bytes)

Decodes a SEC 1 point (uncompressed 0x04 || X || Y, or compressed 0x02/0x03 || X). Raises InvalidPublicKey for anything that is not a point of P-384 or is the point at infinity.

Source

Instance methods

==(other : PublicKey) : Bool
Source
to_compressed

Returns 0x02 || X or 0x03 || X.

Source
to_slice
Source
to_uncompressed

Returns 0x04 || X || Y.

Source
verify(message : Bytes | String, signature : Bytes, *, format : SignatureFormat = SignatureFormat::DER) : Bool

Returns whether signature is an ECDSA signature by this key of message hashed with SHA384.

Source
verify_digest(digest : Bytes, signature : Bytes, *, format : SignatureFormat = SignatureFormat::DER) : Bool

Returns whether signature is an ECDSA signature by this key of a message whose hash is digest (any hash; FIPS 186-5 ยง6.4.2 takes its leftmost bits).

Source