Add support for RSA algorithm
This commit is contained in:
@@ -120,3 +120,6 @@ Returns payload `object`.
|
|||||||
- HS256
|
- HS256
|
||||||
- HS384
|
- HS384
|
||||||
- HS512
|
- HS512
|
||||||
|
- RS256
|
||||||
|
- RS384
|
||||||
|
- RS512
|
||||||
2
index.d.ts
vendored
2
index.d.ts
vendored
@@ -37,7 +37,7 @@ declare class JWT {
|
|||||||
}
|
}
|
||||||
declare const _exports: JWT
|
declare const _exports: JWT
|
||||||
|
|
||||||
type JWTAlgorithm = 'ES256' | 'ES384' | 'ES512' | 'HS256' | 'HS384' | 'HS512'
|
type JWTAlgorithm = 'ES256' | 'ES384' | 'ES512' | 'HS256' | 'HS384' | 'HS512' | 'RS256' | 'RS384' | 'RS512'
|
||||||
|
|
||||||
type JWTSignOptions = {
|
type JWTSignOptions = {
|
||||||
algorithm?: JWTAlgorithm,
|
algorithm?: JWTAlgorithm,
|
||||||
|
|||||||
5
index.js
5
index.js
@@ -17,7 +17,10 @@ class JWT {
|
|||||||
ES512: { name: 'ECDSA', namedCurve: 'P-512', hash: { name: 'SHA-512' } },
|
ES512: { name: 'ECDSA', namedCurve: 'P-512', hash: { name: 'SHA-512' } },
|
||||||
HS256: { name: 'HMAC', hash: { name: 'SHA-256' } },
|
HS256: { name: 'HMAC', hash: { name: 'SHA-256' } },
|
||||||
HS384: { name: 'HMAC', hash: { name: 'SHA-384' } },
|
HS384: { name: 'HMAC', hash: { name: 'SHA-384' } },
|
||||||
HS512: { name: 'HMAC', hash: { name: 'SHA-512' } }
|
HS512: { name: 'HMAC', hash: { name: 'SHA-512' } },
|
||||||
|
RS256: { name: 'RSASSA-PKCS1-v1_5', hash: { name: 'SHA-256' } },
|
||||||
|
RS384: { name: 'RSASSA-PKCS1-v1_5', hash: { name: 'SHA-384' } },
|
||||||
|
RS512: { name: 'RSASSA-PKCS1-v1_5', hash: { name: 'SHA-512' } },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_utf8ToUint8Array(str) {
|
_utf8ToUint8Array(str) {
|
||||||
|
|||||||
Reference in New Issue
Block a user