1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Package errors contains common error types for the OpenPGP packages.
6 package errors // import "golang.org/x/crypto/openpgp/errors"
12 // A StructuralError is returned when OpenPGP data is found to be syntactically
14 type StructuralError string
16 func (s StructuralError) Error() string {
17 return "openpgp: invalid data: " + string(s)
20 // UnsupportedError indicates that, although the OpenPGP data is valid, it
21 // makes use of currently unimplemented features.
22 type UnsupportedError string
24 func (s UnsupportedError) Error() string {
25 return "openpgp: unsupported feature: " + string(s)
28 // InvalidArgumentError indicates that the caller is in error and passed an
30 type InvalidArgumentError string
32 func (i InvalidArgumentError) Error() string {
33 return "openpgp: invalid argument: " + string(i)
36 // SignatureError indicates that a syntactically valid signature failed to
38 type SignatureError string
40 func (b SignatureError) Error() string {
41 return "openpgp: invalid signature: " + string(b)
44 type keyIncorrectError int
46 func (ki keyIncorrectError) Error() string {
47 return "openpgp: incorrect key"
50 var ErrKeyIncorrect error = keyIncorrectError(0)
52 type unknownIssuerError int
54 func (unknownIssuerError) Error() string {
55 return "openpgp: signature made by unknown entity"
58 var ErrUnknownIssuer error = unknownIssuerError(0)
60 type keyRevokedError int
62 func (keyRevokedError) Error() string {
63 return "openpgp: signature made by revoked key"
66 var ErrKeyRevoked error = keyRevokedError(0)
68 type UnknownPacketTypeError uint8
70 func (upte UnknownPacketTypeError) Error() string {
71 return "openpgp: unknown packet type: " + strconv.Itoa(int(upte))