diff --git a/README.md b/README.md index 2b764b4..a7185ec 100644 --- a/README.md +++ b/README.md @@ -119,4 +119,7 @@ Returns payload `object`. - ES512 - HS256 - HS384 - - HS512 \ No newline at end of file + - HS512 + - RS256 + - RS384 + - RS512 \ No newline at end of file diff --git a/index.d.ts b/index.d.ts index 3010f89..30cf1ea 100644 --- a/index.d.ts +++ b/index.d.ts @@ -37,7 +37,7 @@ declare class 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 = { algorithm?: JWTAlgorithm, diff --git a/index.js b/index.js index 951bf49..78821d3 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,10 @@ class JWT { ES512: { name: 'ECDSA', namedCurve: 'P-512', hash: { name: 'SHA-512' } }, HS256: { name: 'HMAC', hash: { name: 'SHA-256' } }, 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) {