jose 5.9.0 → 5.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/jwks/remote.js +1 -1
- package/dist/node/cjs/jwks/remote.js +1 -1
- package/dist/node/cjs/runtime/jwk_to_key.js +5 -2
- package/dist/node/esm/jwks/remote.js +1 -1
- package/dist/node/esm/runtime/jwk_to_key.js +5 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/types.d.ts +9 -5
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ function isCloudflareWorkers() {
|
|
|
10
10
|
let USER_AGENT;
|
|
11
11
|
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
|
|
12
12
|
const NAME = 'jose';
|
|
13
|
-
const VERSION = 'v5.9.
|
|
13
|
+
const VERSION = 'v5.9.2';
|
|
14
14
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
15
15
|
}
|
|
16
16
|
export const jwksCache = Symbol();
|
|
@@ -13,7 +13,7 @@ function isCloudflareWorkers() {
|
|
|
13
13
|
let USER_AGENT;
|
|
14
14
|
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
|
|
15
15
|
const NAME = 'jose';
|
|
16
|
-
const VERSION = 'v5.9.
|
|
16
|
+
const VERSION = 'v5.9.2';
|
|
17
17
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
18
18
|
}
|
|
19
19
|
exports.jwksCache = Symbol();
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const node_crypto_1 = require("node:crypto");
|
|
4
|
-
const parse = (
|
|
5
|
-
|
|
4
|
+
const parse = (key) => {
|
|
5
|
+
if (key.d) {
|
|
6
|
+
return (0, node_crypto_1.createPrivateKey)({ format: 'jwk', key });
|
|
7
|
+
}
|
|
8
|
+
return (0, node_crypto_1.createPublicKey)({ format: 'jwk', key });
|
|
6
9
|
};
|
|
7
10
|
exports.default = parse;
|
|
@@ -10,7 +10,7 @@ function isCloudflareWorkers() {
|
|
|
10
10
|
let USER_AGENT;
|
|
11
11
|
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
|
|
12
12
|
const NAME = 'jose';
|
|
13
|
-
const VERSION = 'v5.9.
|
|
13
|
+
const VERSION = 'v5.9.2';
|
|
14
14
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
15
15
|
}
|
|
16
16
|
export const jwksCache = Symbol();
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { createPrivateKey, createPublicKey } from 'node:crypto';
|
|
2
|
-
const parse = (
|
|
3
|
-
|
|
2
|
+
const parse = (key) => {
|
|
3
|
+
if (key.d) {
|
|
4
|
+
return createPrivateKey({ format: 'jwk', key });
|
|
5
|
+
}
|
|
6
|
+
return createPublicKey({ format: 'jwk', key });
|
|
4
7
|
};
|
|
5
8
|
export default parse;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -44,5 +44,5 @@ export type { GenerateKeyPairResult, GenerateKeyPairOptions } from './key/genera
|
|
|
44
44
|
export { generateSecret } from './key/generate_secret';
|
|
45
45
|
export type { GenerateSecretOptions } from './key/generate_secret';
|
|
46
46
|
export * as base64url from './util/base64url';
|
|
47
|
-
export type { KeyLike, JWK, FlattenedJWSInput, GeneralJWSInput, FlattenedJWS, GeneralJWS, JoseHeaderParameters, JWSHeaderParameters, JWEKeyManagementHeaderParameters, FlattenedJWE, GeneralJWE, JWEHeaderParameters, CritOption, DecryptOptions, EncryptOptions, JWTClaimVerificationOptions, VerifyOptions, SignOptions, JWTPayload, FlattenedDecryptResult, GeneralDecryptResult, CompactDecryptResult, FlattenedVerifyResult, GeneralVerifyResult, CompactVerifyResult, JWTVerifyResult, JWTDecryptResult, ResolvedKey, CompactJWEHeaderParameters, CompactJWSHeaderParameters, JWTHeaderParameters, JSONWebKeySet, CryptoRuntime, GetKeyFunction, } from './types';
|
|
47
|
+
export type { KeyLike, JWK, JWKParameters, JWK_OKP_Public, JWK_OKP_Private, JWK_EC_Public, JWK_EC_Private, JWK_RSA_Public, JWK_RSA_Private, JWK_oct, FlattenedJWSInput, GeneralJWSInput, FlattenedJWS, GeneralJWS, JoseHeaderParameters, JWSHeaderParameters, JWEKeyManagementHeaderParameters, FlattenedJWE, GeneralJWE, JWEHeaderParameters, CritOption, DecryptOptions, EncryptOptions, JWTClaimVerificationOptions, VerifyOptions, SignOptions, JWTPayload, FlattenedDecryptResult, GeneralDecryptResult, CompactDecryptResult, FlattenedVerifyResult, GeneralVerifyResult, CompactVerifyResult, JWTVerifyResult, JWTDecryptResult, ResolvedKey, CompactJWEHeaderParameters, CompactJWSHeaderParameters, JWTHeaderParameters, JSONWebKeySet, CryptoRuntime, GetKeyFunction, } from './types';
|
|
48
48
|
export { default as cryptoRuntime } from './util/runtime';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -113,9 +113,7 @@ export interface JWK_RSA_Private extends JWK_RSA_Public, JWKParameters {
|
|
|
113
113
|
qi: string
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
/**
|
|
117
|
-
* Convenience interface for oct JSON Web Keys
|
|
118
|
-
*/
|
|
116
|
+
/** Convenience interface for oct JSON Web Keys */
|
|
119
117
|
export interface JWK_oct extends JWKParameters {
|
|
120
118
|
/** Key Value */
|
|
121
119
|
k: string
|
|
@@ -124,6 +122,14 @@ export interface JWK_oct extends JWKParameters {
|
|
|
124
122
|
/**
|
|
125
123
|
* JSON Web Key ({@link https://www.rfc-editor.org/rfc/rfc7517 JWK}). "RSA", "EC", "OKP", and "oct"
|
|
126
124
|
* key types are supported.
|
|
125
|
+
*
|
|
126
|
+
* @see {@link JWK_OKP_Public}
|
|
127
|
+
* @see {@link JWK_OKP_Private}
|
|
128
|
+
* @see {@link JWK_EC_Public}
|
|
129
|
+
* @see {@link JWK_EC_Private}
|
|
130
|
+
* @see {@link JWK_RSA_Public}
|
|
131
|
+
* @see {@link JWK_RSA_Private}
|
|
132
|
+
* @see {@link JWK_oct}
|
|
127
133
|
*/
|
|
128
134
|
export interface JWK extends JWKParameters {
|
|
129
135
|
/**
|
|
@@ -166,8 +172,6 @@ export interface JWK extends JWKParameters {
|
|
|
166
172
|
x?: string
|
|
167
173
|
/** (EC) Y Coordinate */
|
|
168
174
|
y?: string
|
|
169
|
-
|
|
170
|
-
[propName: string]: unknown
|
|
171
175
|
}
|
|
172
176
|
|
|
173
177
|
/**
|