UNPKG

cose-kit

Version:

**DEPRECATED:** Use [@auth0/cose](https://www.npmjs.com/package/@auth0/cose).

133 lines (132 loc) 4.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.COSESignatureVerificationFailed = exports.COSEInvalid = exports.COSEEncryptedInvalid = exports.COSEDecryptionFailed = exports.X509InvalidCertificateChain = exports.X509NoMatchingCertificate = exports.JWKSMultipleMatchingKeys = exports.JWKSNoMatchingKey = exports.JWKSInvalid = exports.COSENotSupported = exports.COSEAlgNotAllowed = exports.COSEError = void 0; class COSEError extends Error { static get code() { return 'ERR_COSE_GENERIC'; } constructor(message) { var _a; super(message); this.code = 'ERR_COSE_GENERIC'; this.name = this.constructor.name; (_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, this, this.constructor); } } exports.COSEError = COSEError; class COSEAlgNotAllowed extends COSEError { constructor() { super(...arguments); this.code = 'ERR_COSE_ALG_NOT_ALLOWED'; } static get code() { return 'ERR_COSE_ALG_NOT_ALLOWED'; } } exports.COSEAlgNotAllowed = COSEAlgNotAllowed; class COSENotSupported extends COSEError { constructor() { super(...arguments); this.code = 'ERR_COSE_NOT_SUPPORTED'; } static get code() { return 'ERR_COSE_NOT_SUPPORTED'; } } exports.COSENotSupported = COSENotSupported; class JWKSInvalid extends COSEError { constructor() { super(...arguments); this.code = 'ERR_JWKS_INVALID'; } static get code() { return 'ERR_JWKS_INVALID'; } } exports.JWKSInvalid = JWKSInvalid; class JWKSNoMatchingKey extends COSEError { constructor() { super(...arguments); this.code = 'ERR_JWKS_NO_MATCHING_KEY'; this.message = 'no applicable key found in the JSON Web Key Set'; } static get code() { return 'ERR_JWKS_NO_MATCHING_KEY'; } } exports.JWKSNoMatchingKey = JWKSNoMatchingKey; class JWKSMultipleMatchingKeys extends COSEError { constructor() { super(...arguments); this.code = 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; this.message = 'multiple matching keys found in the JSON Web Key Set'; } static get code() { return 'ERR_JWKS_MULTIPLE_MATCHING_KEYS'; } } exports.JWKSMultipleMatchingKeys = JWKSMultipleMatchingKeys; Symbol.asyncIterator; class X509NoMatchingCertificate extends COSEError { constructor() { super(...arguments); this.code = 'ERR_X509_NO_MATCHING_CERTIFICATE'; this.message = 'no applicable certificate found in the COSE headers'; } static get code() { return 'ERR_X509_NO_MATCHING_CERTIFICATE'; } } exports.X509NoMatchingCertificate = X509NoMatchingCertificate; class X509InvalidCertificateChain extends COSEError { constructor() { super(...arguments); this.code = 'ERR_X509_INVALID_CERTIFICATE_CHAIN'; } static get code() { return 'ERR_X509_INVALID_CERTIFICATE_CHAIN'; } } exports.X509InvalidCertificateChain = X509InvalidCertificateChain; class COSEDecryptionFailed extends COSEError { constructor() { super(...arguments); this.code = 'ERR_COSE_DECRYPTION_FAILED'; this.message = 'decryption operation failed'; } static get code() { return 'ERR_COSE_DECRYPTION_FAILED'; } } exports.COSEDecryptionFailed = COSEDecryptionFailed; class COSEEncryptedInvalid extends COSEError { constructor() { super(...arguments); this.code = 'ERR_COSE_ENCRYPTED_INVALID'; } static get code() { return 'ERR_COSE_ENCRYPTED_INVALID'; } } exports.COSEEncryptedInvalid = COSEEncryptedInvalid; class COSEInvalid extends COSEError { constructor() { super(...arguments); this.code = 'ERR_COSE_INVALID'; } static get code() { return 'ERR_COSE_INVALID'; } } exports.COSEInvalid = COSEInvalid; class COSESignatureVerificationFailed extends COSEError { constructor() { super(...arguments); this.code = 'ERR_COSE_SIGNATURE_VERIFICATION_FAILED'; this.message = 'signature verification failed'; } static get code() { return 'ERR_COSE_SIGNATURE_VERIFICATION_FAILED'; } } exports.COSESignatureVerificationFailed = COSESignatureVerificationFailed;