Skip to main content
Deno 2 is finally here 🎉️
Learn more
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.1.0/mod.ts";

Supported JWS alg Algorithm identifiers.

Examples

CryptoKey algorithm for the PS256, PS384, or PS512 JWS Algorithm Identifiers

interface RSAPSSAlgorithm extends RsaHashedKeyAlgorithm {
  name: 'RSA-PSS'
  hash: { name: 'SHA-256' | 'SHA-384' | 'SHA-512' }
}

interface PS256 extends RSAPSSAlgorithm {
  hash: { name: 'SHA-256' }
}

interface PS384 extends RSAPSSAlgorithm {
  hash: { name: 'SHA-384' }
}

interface PS512 extends RSAPSSAlgorithm {
  hash: { name: 'SHA-512' }
}

CryptoKey algorithm for the ES256, ES384, or ES512 JWS Algorithm Identifiers

interface ECDSAAlgorithm extends EcKeyAlgorithm {
  name: 'ECDSA'
  namedCurve: 'P-256' | 'P-384' | 'P-521'
}

interface ES256 extends ECDSAAlgorithm {
  namedCurve: 'P-256'
}

interface ES384 extends ECDSAAlgorithm {
  namedCurve: 'P-384'
}

interface ES512 extends ECDSAAlgorithm {
  namedCurve: 'P-521'
}

CryptoKey algorithm for the RS256, RS384, or RS512 JWS Algorithm Identifiers

interface ECDSAAlgorithm extends RsaHashedKeyAlgorithm {
  name: 'RSASSA-PKCS1-v1_5'
  hash: { name: 'SHA-256' | 'SHA-384' | 'SHA-512' }
}

interface RS256 extends ECDSAAlgorithm {
  hash: { name: 'SHA-256' }
}

interface RS384 extends ECDSAAlgorithm {
  hash: { name: 'SHA-384' }
}

interface RS512 extends ECDSAAlgorithm {
  hash: { name: 'SHA-512' }
}

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 EdDSA extends KeyAlgorithm {
  name: 'Ed25519' | 'Ed448'
}
definition:
| "PS256"
| "ES256"
| "RS256"
| "EdDSA"
| "ES384"
| "PS384"
| "RS384"
| "ES512"
| "PS512"
| "RS512"