this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

CLI: Fix incorrect private key serialization

futurGH 5cd593dd a37da363

+3 -3
+3 -3
src/scripts/plc.ts
··· 1 + import { fromBytes, toBytes } from "@atcute/cbor"; 1 2 import type { ComAtprotoIdentitySignPlcOperation } from "@atcute/client/lexicons"; 2 3 import { secp256k1 as k256 } from "@noble/curves/secp256k1"; 3 - import * as ui8 from "uint8arrays"; 4 4 import { formatDidKey, SECP256K1_JWT_ALG } from "../util/crypto.js"; 5 5 import { loginAgent, LoginCredentials } from "./util.js"; 6 6 ··· 52 52 const privateKey = options.privateKey 53 53 ? options.privateKey instanceof Uint8Array 54 54 ? options.privateKey 55 - : ui8.fromString(options.privateKey, "hex") 55 + : fromBytes({ $bytes: options.privateKey }) 56 56 : k256.utils.randomPrivateKey(); 57 57 58 58 const publicKey = k256.getPublicKey(privateKey); ··· 104 104 }); 105 105 106 106 if (!options.privateKey && operation.verificationMethods) { 107 - const privateKeyString = ui8.toString(privateKey, "hex"); 107 + const privateKeyString = toBytes(privateKey).$bytes; 108 108 console.log( 109 109 "This is your labeler's signing key. It will be needed to sign any labels you create.", 110 110 "You will not be able to retrieve this key again, so make sure to save it somewhere safe.",