std/signature/error

std/signature/src/error.trb

SignatureError: why bytes or a text are not a key or a signature.

type SignatureError

type SignatureError with Show, Error

Why bytes or a text are not a key or a signature, of Ed25519, of P-256 or of RSA. A failed verification is not one: verifies of a public key answers false, since a signature that does not verify has nothing more to say.

case WrongLength

case WrongLength(what: String, expected: Int, found: Int)

what has expected bytes, and found were given.

case NotHexadecimal

case NotHexadecimal(what: String, reason: String)

The text of what is not two hexadecimal digits per byte: reason says where.

case NotAPoint

case NotAPoint

The bytes of a public key do not encode a point of its curve, or not in the one canonical way.

case ScalarOutOfRange

case ScalarOutOfRange

A scalar of a signature is outside its range: an Ed25519 S that is not below the group order L (RFC 8032 section 5.1.7), or a P-256 r or s that is 0 or not below the group order n (FIPS 186-5 section 6.4.2).

case NotDer

case NotDer(reason: String)

The bytes of a P-256 signature are not the one strict DER encoding of r and s: reason says where.

case NotAnRsaKey

case NotAnRsaKey(reason: String)

The modulus and exponent do not make an RSA public key this library verifies with: reason says which is wrong.

fn show

fn show(): String

One line: what was expected, and what was there instead.