cose-kit
Version:
**DEPRECATED:** Use [@auth0/cose](https://www.npmjs.com/package/@auth0/cose).
118 lines (117 loc) • 3.34 kB
JavaScript
export 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);
}
}
export class COSEAlgNotAllowed extends COSEError {
constructor() {
super(...arguments);
this.code = 'ERR_COSE_ALG_NOT_ALLOWED';
}
static get code() {
return 'ERR_COSE_ALG_NOT_ALLOWED';
}
}
export class COSENotSupported extends COSEError {
constructor() {
super(...arguments);
this.code = 'ERR_COSE_NOT_SUPPORTED';
}
static get code() {
return 'ERR_COSE_NOT_SUPPORTED';
}
}
export class JWKSInvalid extends COSEError {
constructor() {
super(...arguments);
this.code = 'ERR_JWKS_INVALID';
}
static get code() {
return 'ERR_JWKS_INVALID';
}
}
export 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';
}
}
export 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';
}
}
Symbol.asyncIterator;
export 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';
}
}
export class X509InvalidCertificateChain extends COSEError {
constructor() {
super(...arguments);
this.code = 'ERR_X509_INVALID_CERTIFICATE_CHAIN';
}
static get code() {
return 'ERR_X509_INVALID_CERTIFICATE_CHAIN';
}
}
export 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';
}
}
export class COSEEncryptedInvalid extends COSEError {
constructor() {
super(...arguments);
this.code = 'ERR_COSE_ENCRYPTED_INVALID';
}
static get code() {
return 'ERR_COSE_ENCRYPTED_INVALID';
}
}
export class COSEInvalid extends COSEError {
constructor() {
super(...arguments);
this.code = 'ERR_COSE_INVALID';
}
static get code() {
return 'ERR_COSE_INVALID';
}
}
export 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';
}
}