errors

package
v2.679.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package errors provides crypto-specific error values shared across go-service crypto helpers.

The package centralizes sentinel errors that callers can compare with errors.Is regardless of which concrete crypto helper produced them.

Current sentinels include:

  • ErrInvalidMatch: a verification operation failed because the provided signature, MAC, or hash did not match the message.
  • ErrMissingKey: required key material was absent or resolved to empty bytes.
  • ErrInvalidKeyType: key material decoded successfully, but the contained key algorithm did not match what the caller expected.
  • ErrInvalidKeySize: key material decoded successfully, but the key size does not satisfy the package policy for the operation.
  • ErrInvalidKeyFormat: key material decoded successfully, but used an unsupported syntactic form.

These sentinels are intentionally small and reusable so higher-level packages can add context by wrapping them without losing comparability.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidKeyFormat = errors.New("crypto: invalid key format")

ErrInvalidKeyFormat indicates that parsed key material used a syntactic form that is not supported by the package.

View Source
var ErrInvalidKeySize = errors.New("crypto: invalid key size")

ErrInvalidKeySize indicates that parsed key material was valid, but its size does not satisfy the package policy for the cryptographic operation.

View Source
var ErrInvalidKeyType = errors.New("crypto: invalid key type")

ErrInvalidKeyType indicates that parsed key material was valid, but not of the key type expected by the caller.

It is used by key-loading helpers that only support a specific algorithm (for example Ed25519) when the provided data decodes successfully as some other key type.

View Source
var ErrInvalidMatch = errors.New("crypto: invalid match")

ErrInvalidMatch indicates that a cryptographic verification check failed.

It is used by verification helpers (for example signature verifiers) to report that a provided signature/hash does not match the expected value for the input message.

View Source
var ErrMissingKey = errors.New("crypto: missing key")

ErrMissingKey indicates that required cryptographic key material was not configured or resolved to empty bytes.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL