| 1 | // |
| 2 | // Copyright (c) SAS Institute Inc. |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | package sigerrors |
| 18 | |
| 19 | import ( |
| 20 | "errors" |
| 21 | ) |
| 22 | |
| 23 | var ( |
| 24 | ErrExist = errors.New("object already exists in token") |
| 25 | ) |
| 26 | |
| 27 | type KeyNotFoundError struct{} |
| 28 | |
| 29 | func (KeyNotFoundError) Error() string { |
| 30 | return "No object found in token with the specified label" |
| 31 | } |
| 32 | |
| 33 | type PinIncorrectError struct{} |
| 34 | |
| 35 | func (PinIncorrectError) Error() string { |
| 36 | return "The entered PIN was incorrect" |
| 37 | } |
| 38 | |
| 39 | type ErrNoCertificate struct { |
| 40 | Type string |
| 41 | } |
| 42 | |
| 43 | func (e ErrNoCertificate) Error() string { |
| 44 | return "no certificate of type \"" + e.Type + "\" defined for this key" |
| 45 | } |
| 46 | |
| 47 | type NotSignedError struct { |
| 48 | Type string |
| 49 | } |
| 50 | |
| 51 | func (e NotSignedError) Error() string { |
| 52 | return e.Type + " contains no signatures" |
| 53 | } |