OSDN Git Service

new repo
[bytom/vapor.git] / vendor / golang.org / x / crypto / openpgp / errors / errors.go
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.
4
5 // Package errors contains common error types for the OpenPGP packages.
6 package errors // import "golang.org/x/crypto/openpgp/errors"
7
8 import (
9         "strconv"
10 )
11
12 // A StructuralError is returned when OpenPGP data is found to be syntactically
13 // invalid.
14 type StructuralError string
15
16 func (s StructuralError) Error() string {
17         return "openpgp: invalid data: " + string(s)
18 }
19
20 // UnsupportedError indicates that, although the OpenPGP data is valid, it
21 // makes use of currently unimplemented features.
22 type UnsupportedError string
23
24 func (s UnsupportedError) Error() string {
25         return "openpgp: unsupported feature: " + string(s)
26 }
27
28 // InvalidArgumentError indicates that the caller is in error and passed an
29 // incorrect value.
30 type InvalidArgumentError string
31
32 func (i InvalidArgumentError) Error() string {
33         return "openpgp: invalid argument: " + string(i)
34 }
35
36 // SignatureError indicates that a syntactically valid signature failed to
37 // validate.
38 type SignatureError string
39
40 func (b SignatureError) Error() string {
41         return "openpgp: invalid signature: " + string(b)
42 }
43
44 type keyIncorrectError int
45
46 func (ki keyIncorrectError) Error() string {
47         return "openpgp: incorrect key"
48 }
49
50 var ErrKeyIncorrect error = keyIncorrectError(0)
51
52 type unknownIssuerError int
53
54 func (unknownIssuerError) Error() string {
55         return "openpgp: signature made by unknown entity"
56 }
57
58 var ErrUnknownIssuer error = unknownIssuerError(0)
59
60 type keyRevokedError int
61
62 func (keyRevokedError) Error() string {
63         return "openpgp: signature made by revoked key"
64 }
65
66 var ErrKeyRevoked error = keyRevokedError(0)
67
68 type UnknownPacketTypeError uint8
69
70 func (upte UnknownPacketTypeError) Error() string {
71         return "openpgp: unknown packet type: " + strconv.Itoa(int(upte))
72 }