| 1 |
package certstore |
| 2 |
|
| 3 |
import ( |
| 4 |
"errors" |
| 5 |
) |
| 6 |
|
| 7 |
var ( |
| 8 |
// ErrBadCryptoStoreProvider represents inablity to establish link with a certificate store |
| 9 |
ErrBadCryptoStoreProvider = errors.New("unable to open certificate store or store not available") |
| 10 |
|
| 11 |
// ErrBadRSAHashAlgorithm represents a bad or unsupported RSA hash algorithm |
| 12 |
ErrBadRSAHashAlgorithm = errors.New("unsupported RSA hash algorithm") |
| 13 |
|
| 14 |
// ErrBadSigningAlgorithm represents a bad or unsupported signing algorithm |
| 15 |
ErrBadSigningAlgorithm = errors.New("unsupported signing algorithm") |
| 16 |
|
| 17 |
// ErrStoreRSASigningError represents an error returned from store during RSA signature |
| 18 |
ErrStoreRSASigningError = errors.New("unable to obtain RSA signature from store") |
| 19 |
|
| 20 |
// ErrStoreECDSASigningError represents an error returned from store during ECDSA signature |
| 21 |
ErrStoreECDSASigningError = errors.New("unable to obtain ECDSA signature from store") |
| 22 |
|
| 23 |
// ErrNoPrivateKeyStoreRef represents an error getting a handle to a private key in store |
| 24 |
ErrNoPrivateKeyStoreRef = errors.New("unable to obtain private key handle from store") |
| 25 |
|
| 26 |
// ErrExtractingPrivateKeyMetadata represents a family of errors extracting metadata about the private key in store |
| 27 |
ErrExtractingPrivateKeyMetadata = errors.New("unable to extract private key metadata") |
| 28 |
|
| 29 |
// ErrExtractingECCPublicKey represents an error exporting ECC-type public key from store |
| 30 |
ErrExtractingECCPublicKey = errors.New("unable to extract ECC public key from store") |
| 31 |
|
| 32 |
// ErrExtractingRSAPublicKey represents an error exporting RSA-type public key from store |
| 33 |
ErrExtractingRSAPublicKey = errors.New("unable to extract RSA public key from store") |
| 34 |
|
| 35 |
// ErrExtractingPublicKey represents a general error exporting public key from store |
| 36 |
ErrExtractingPublicKey = errors.New("unable to extract public key from store") |
| 37 |
|
| 38 |
// ErrBadPublicKeyAlgorithm represents a bad or unsupported public key algorithm |
| 39 |
ErrBadPublicKeyAlgorithm = errors.New("unsupported public key algorithm") |
| 40 |
|
| 41 |
// ErrExtractPropertyFromKey represents a general failure to extract a metadata property field |
| 42 |
ErrExtractPropertyFromKey = errors.New("unable to extract property from key") |
| 43 |
|
| 44 |
// ErrBadECCCurveName represents an ECC signature curve name that is bad or unsupported |
| 45 |
ErrBadECCCurveName = errors.New("unsupported ECC curve name") |
| 46 |
|
| 47 |
// ErrFailedCertSearch represents not able to find certificate in store |
| 48 |
ErrFailedCertSearch = errors.New("unable to find certificate in store") |
| 49 |
|
| 50 |
// ErrFailedX509Extract represents not being able to extract x509 certificate from found cert in store |
| 51 |
ErrFailedX509Extract = errors.New("unable to extract x509 from certificate") |
| 52 |
|
| 53 |
// ErrBadMatchByType represents unknown CERT_MATCH_BY passed |
| 54 |
ErrBadMatchByType = errors.New("cert match by type not implemented") |
| 55 |
|
| 56 |
// ErrBadCertStore represents unknown CERT_STORE passed |
| 57 |
ErrBadCertStore = errors.New("cert store type not implemented") |
| 58 |
|
| 59 |
// ErrConflictCertFileAndStore represents ambiguous configuration of both file and store |
| 60 |
ErrConflictCertFileAndStore = errors.New("'cert_file' and 'cert_store' may not both be configured") |
| 61 |
|
| 62 |
// ErrBadCertStoreField represents malformed cert_store option |
| 63 |
ErrBadCertStoreField = errors.New("expected 'cert_store' to be a valid non-empty string") |
| 64 |
|
| 65 |
// ErrBadCertMatchByField represents malformed cert_match_by option |
| 66 |
ErrBadCertMatchByField = errors.New("expected 'cert_match_by' to be a valid non-empty string") |
| 67 |
|
| 68 |
// ErrBadCertMatchField represents malformed cert_match option |
| 69 |
ErrBadCertMatchField = errors.New("expected 'cert_match' to be a valid non-empty string") |
| 70 |
|
| 71 |
// ErrBadCaCertMatchField represents malformed cert_match option |
| 72 |
ErrBadCaCertMatchField = errors.New("expected 'ca_certs_match' to be a valid non-empty string array") |
| 73 |
|
| 74 |
// ErrBadCertMatchSkipInvalidField represents malformed cert_match_skip_invalid option |
| 75 |
ErrBadCertMatchSkipInvalidField = errors.New("expected 'cert_match_skip_invalid' to be a boolean") |
| 76 |
|
| 77 |
// ErrOSNotCompatCertStore represents cert_store passed that exists but is not valid on current OS |
| 78 |
ErrOSNotCompatCertStore = errors.New("cert_store not compatible with current operating system") |
| 79 |
) |