Skip to content

Commit

Permalink
fix(jwk-webcrypto): remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieusieben committed Apr 12, 2024
1 parent 56aa243 commit 718b387
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 54 deletions.
1 change: 0 additions & 1 deletion packages/jwk-webcrypto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"build": "tsc --build tsconfig.build.json"
},
"dependencies": {
"@atproto/indexed-db": "workspace:*",
"@atproto/jwk": "workspace:*",
"@atproto/jwk-jose": "workspace:*"
},
Expand Down
42 changes: 0 additions & 42 deletions packages/jwk-webcrypto/src/db.ts

This file was deleted.

10 changes: 2 additions & 8 deletions packages/jwk-webcrypto/src/webcrypto-key.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import { Jwk, jwkSchema } from '@atproto/jwk'
import { JoseKey } from '@atproto/jwk-jose'
// XXX TODO: remove "./db.ts" file
// import { loadCryptoKeyPair } from './db.js'

import {
generateKeypair,
fromSubtleAlgorithm,
isSignatureKeyPair,
} from './util.js'

export class WebcryptoKey extends JoseKey {
// static async fromIndexedDB(kid: string, allowedAlgos: string[] = ['ES384']) {
// const cryptoKeyPair = await loadCryptoKeyPair(kid, allowedAlgos)
// return this.fromKeypair(kid, cryptoKeyPair)
// }

static async generate(
kid: string = crypto.randomUUID(),
allowedAlgos: string[] = ['ES384'],
allowedAlgos: string[] = ['ES256'],
exportable = false,
) {
const cryptoKeyPair = await generateKeypair(allowedAlgos, exportable)
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 718b387

Please sign in to comment.