-
Notifications
You must be signed in to change notification settings - Fork 3
/
errors.go
66 lines (51 loc) · 1.33 KB
/
errors.go
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package http_signature_auth
import (
"crypto/tls"
"fmt"
)
type SignatureNotFound struct {
}
func (e SignatureNotFound) Error() string {
return "Signature not found"
}
type MalformedHTTPSignatureAuth struct {
Msg string
}
func (e MalformedHTTPSignatureAuth) Error() string {
return "Malformed HTTP Concealed Auth: " + e.Msg
}
type InvalidTLSSignatureSchemeFormat struct {
Value string
}
func (e InvalidTLSSignatureSchemeFormat) Error() string {
return "Invalid signature scheme format: " + e.Value
}
type TLSSignatureSchemeNotSupported struct {
Scheme tls.SignatureScheme
Reason string
}
func (e TLSSignatureSchemeNotSupported) Error() string {
str := fmt.Sprintf("Signature scheme not supported: %s", e.Scheme.String())
if e.Reason != "" {
str += " (" + e.Reason + ")"
}
return str
}
type InvalidPublicKeyFormat struct {
scheme tls.SignatureScheme
}
func (e InvalidPublicKeyFormat) Error() string {
return fmt.Sprintf("Invalid public key format for signature scheme %s", e.scheme)
}
type UnsupportedKeyType struct {
Type string
}
func (e UnsupportedKeyType) Error() string {
return "Unsupported public key type: " + e.Type
}
type PublicKeysMismatch struct {
keyID KeyID
}
func (e PublicKeysMismatch) Error() string {
return fmt.Sprintf("The proposed key with key ID %s does not match the public key in the database", e.keyID)
}