( privateKey: string, )
| 192 | |
| 193 | /** From base64 encoded private key */ |
| 194 | export const generatePublicKeyFromPrivate = async ( |
| 195 | privateKey: string, |
| 196 | ): Promise<string> => { |
| 197 | const privateKeyArrayBuffer = decodeB64(privateKey); |
| 198 | const privateKeyBytes: Uint8Array = new Uint8Array(privateKeyArrayBuffer); |
| 199 | const publickey = await getPublicKey(privateKeyBytes); |
| 200 | const publicBase64 = encodeB64(publickey); |
| 201 | return publicBase64; |
| 202 | }; |
| 203 | |
| 204 | interface KeyPair { |
| 205 | publicKey: string; |