squash
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:
@@ -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)!
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user