fix android module name

import fixes

fix some imports

use `@atproto/jwk` over local zod schema

preview oauth client

rename package

alignment

more alignment

database implementation

cleanup some types

alignment

switch implementation for es256

half of `verifyJwt` for android

half of `verifyJwt` for iOS

rm log

`createJwt` android

`createJwt` ios

rm print

cleanup native impl

silence some warnings

reorg, finish web impl

follow the `CryptoImplementation`

move some more things around

normalize some names

rename func

add generate on android

add android dep

rm bool

add alg

better implementation

ios jwk generation

fix index.ts

add `getRandomValues()` on native

web `getRandomValues`

silence ts error for missing crypto on web

add `digest` for web

add `digest`

add module
This commit is contained in:
Hailey
2024-04-10 12:58:41 -07:00
parent 310d865440
commit 13607edd43
27 changed files with 1502 additions and 0 deletions
@@ -0,0 +1,29 @@
struct JWK {
let kty: String
let use: String
let crv: String
let kid: String
let x: String
let y: String
var d: String?
let alg: String
func toJson() -> String {
var dict: [String: Any] = [
"kty": kty,
"use": use,
"crv": crv,
"kid": kid,
"x": x,
"y": y,
"alg": alg,
]
if let d = d {
dict["d"] = d
}
let jsonData = try! JSONSerialization.data(withJSONObject: dict, options: [])
return String(data: jsonData, encoding: .utf8)!
}
}