This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Buffer } from 'node:buffer'; | |
import fs from "node:fs"; | |
import url from 'node:url'; | |
import path from "node:path"; | |
const {createCipheriv, createDecipheriv, randomFill, generateKey} = await import('node:crypto'); | |
var claims = {name:"Joe",roles:["member","admin"]}; | |
var keyEncryptionKey; | |
var ivKEK; | |
var contentEncryptionKey; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Buffer } from 'node:buffer'; | |
import fs from "node:fs"; | |
import url from 'node:url'; | |
import path from "node:path"; | |
const {createSign, createVerify, generateKeyPairSync} = await import('node:crypto'); | |
var claims = {name:"Joe",roles:["member","admin"]}; | |
var { privateKey, publicKey } = generateKeyPairSync("ec", { | |
namedCurve: 'secp256k1', | |
publicKeyEncoding: { | |
type: 'spki', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Buffer } from 'node:buffer'; | |
import fs from "node:fs"; | |
import url from 'node:url'; | |
import path from "node:path"; | |
const {createHmac, generateKey} = await import('node:crypto'); | |
var claims = {name:"Joe",roles:["member","admin"]}; | |
var secretKey; | |
(async function () { | |
secretKey = await generateSecretKey(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Buffer } from 'node:buffer'; | |
import fs from "node:fs"; | |
import url from 'node:url'; | |
import path from "node:path"; | |
const {createSign, createVerify, generateKeyPairSync} = await import('node:crypto'); | |
var claims = {name:"Joe",roles:["member","admin"]}; | |
var { privateKey, publicKey } = generateKeyPairSync("rsa", { | |
modulusLength: 2048, | |
publicKeyEncoding: { | |
type: 'spki', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Buffer } from 'node:buffer'; | |
import fs from "node:fs"; | |
import url from 'node:url'; | |
import path from "node:path"; | |
const {createCipheriv, createDecipheriv, createSecretKey, randomFill, generateKey} = await import('node:crypto'); | |
var aesKey; | |
var claims = {name:"Joe",roles:["member","admin"]}; | |
(async function () { | |
console.log("\x1b[31mInvalid Token") |