summaryrefslogtreecommitdiff
path: root/std/jwt/_algorithm.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/jwt/_algorithm.ts')
-rw-r--r--std/jwt/_algorithm.ts17
1 files changed, 0 insertions, 17 deletions
diff --git a/std/jwt/_algorithm.ts b/std/jwt/_algorithm.ts
deleted file mode 100644
index c9c5257e1..000000000
--- a/std/jwt/_algorithm.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * JSW ยง1: Cryptographic algorithms and identifiers for use with this specification
- * are described in the separate JSON Web Algorithms (JWA) specification:
- * https://www.rfc-editor.org/rfc/rfc7518
- */
-export type Algorithm = "none" | "HS256" | "HS512";
-export type AlgorithmInput = Algorithm | Array<Exclude<Algorithm, "none">>;
-/**
- * Verify the algorithm
- * @param algorithm as string or multiple algorithms in an array excluding 'none'
- * @param the algorithm from the jwt header
- */
-export function verify(algorithm: AlgorithmInput, jwtAlg: string): boolean {
- return Array.isArray(algorithm)
- ? (algorithm as string[]).includes(jwtAlg)
- : algorithm === jwtAlg;
-}