Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
20 lines
642 B
Plaintext
20 lines
642 B
Plaintext
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.isJWK = isJWK;
|
|
exports.isPrivateJWK = isPrivateJWK;
|
|
exports.isPublicJWK = isPublicJWK;
|
|
exports.isSecretJWK = isSecretJWK;
|
|
const is_object_js_1 = require("./is_object.js");
|
|
function isJWK(key) {
|
|
return (0, is_object_js_1.default)(key) && typeof key.kty === 'string';
|
|
}
|
|
function isPrivateJWK(key) {
|
|
return key.kty !== 'oct' && typeof key.d === 'string';
|
|
}
|
|
function isPublicJWK(key) {
|
|
return key.kty !== 'oct' && typeof key.d === 'undefined';
|
|
}
|
|
function isSecretJWK(key) {
|
|
return isJWK(key) && key.kty === 'oct' && typeof key.k === 'string';
|
|
}
|