()
| 207 | } |
| 208 | |
| 209 | export async function generateKeyPair(): Promise<KeyPair> { |
| 210 | const privateBytes = utils.randomPrivateKey(); |
| 211 | const publicBytes = await getPublicKey(privateBytes); |
| 212 | const privateKey = encodeB64(privateBytes); |
| 213 | const publicKey = encodeB64(publicBytes); |
| 214 | return { |
| 215 | publicKey, |
| 216 | privateKey, |
| 217 | }; |
| 218 | } |
| 219 | |
| 220 | /** Parses a JSON-AD Commit, applies it to the store. Does not perform checks */ |
| 221 | export function parseAndApply(jsonAdObjStr: string, store: Store) { |