Skip to main content
Module

x/oauth4webapi/mod.ts>JWSAlgorithm

OAuth 2 / OpenID Connect for Web Platform API JavaScript runtimes
Go to Latest
type alias JWSAlgorithm
import { type JWSAlgorithm } from "https://deno.land/x/oauth4webapi@v2.0.0/mod.ts";

Supported JWS alg Algorithm identifiers.

Examples

CryptoKey algorithm for the PS256 JWS Algorithm Identifier

interface Ps256Algorithm extends RsaHashedKeyAlgorithm {
  name: 'RSA-PSS'
  hash: { name: 'SHA-256' }
}

CryptoKey algorithm for the ES256 JWS Algorithm Identifier

interface Es256Algorithm extends EcKeyAlgorithm {
  name: 'ECDSA'
  namedCurve: 'P-256'
}

CryptoKey algorithm for the RS256 JWS Algorithm Identifier

interface Rs256Algorithm extends RsaHashedKeyAlgorithm {
  name: 'RSASSA-PKCS1-v1_5'
  hash: { name: 'SHA-256' }
}

CryptoKey algorithm for the EdDSA JWS Algorithm Identifier (Experimental)

Runtime support for this algorithm is very limited, it depends on the Secure Curves in the Web Cryptography API proposal which is yet to be widely adopted. If the proposal changes this implementation will follow up with a minor release.

interface EdDSAAlgorithm extends KeyAlgorithm {
  name: 'Ed25519'
}
definition:
| "PS256"
| "ES256"
| "RS256"
| "EdDSA"