-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
45 lines (34 loc) · 1.74 KB
/
Copy patherrors.go
File metadata and controls
45 lines (34 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package cardhl
import "errors"
// Sentinel errors returned by this package. Use errors.Is to match them; the
// concrete error returned usually wraps one of these with extra context from
// the card or PC/SC layer.
var (
// ErrNoPCSC is returned when the PC/SC daemon cannot be reached. On Linux
// this almost always means pcscd is not running.
ErrNoPCSC = errors.New("cannot connect to PC/SC daemon")
// ErrNoCard is returned when no smartcard exposing the OpenPGP applet is
// present on any reader.
ErrNoCard = errors.New("no OpenPGP smartcard found")
// ErrCardInit is returned when a card is present but the OpenPGP applet
// could not be initialized.
ErrCardInit = errors.New("failed to initialize OpenPGP card")
// ErrPIN is returned when PIN (PW1) verification fails.
ErrPIN = errors.New("PIN verification failed")
// ErrNoKey is returned when the requested key slot (sign/decrypt) holds no
// key, or no public-key material could be read for it.
ErrNoKey = errors.New("no key in slot")
// ErrUnsupportedKey is returned when the key's algorithm is not supported
// for the requested operation.
ErrUnsupportedKey = errors.New("unsupported key algorithm")
// ErrSign is returned when the card refuses or fails a signing operation.
ErrSign = errors.New("signing failed")
// ErrDecrypt is returned when a message cannot be decrypted with the card's
// decryption key.
ErrDecrypt = errors.New("decryption failed")
// ErrBadKeyFile is returned when a public key file cannot be parsed.
ErrBadKeyFile = errors.New("could not parse public key")
// ErrMIME is returned when a PGP/MIME message is malformed or cannot be
// parsed for a card operation (e.g. missing boundary, wrong media type).
ErrMIME = errors.New("invalid PGP/MIME structure")
)