···2323} from "./util/types.js";
2424import { excludeNullish, frameToBytes } from "./util/util.js";
25252626+const INVALID_SIGNING_KEY_ERROR = `Make sure to provide a private signing key, not a public key.
2727+2828+If you don't have a key, generate and set one using the \`npx @skyware/labeler setup\` command or the \`import { plcSetupLabeler } from "@skyware/labeler/scripts"\` function.
2929+For more information, see https://skyware.js.org/guides/labeler/introduction/getting-started/`;
3030+2631/**
2732 * Options for the {@link LabelerServer} class.
2833 */
···7479 */
7580 constructor(options: LabelerOptions) {
7681 this.did = options.did as At.DID;
8282+ this.auth = options.auth ?? ((did) => did === this.did);
8383+8484+ if (options.signingKey.startsWith("did:key:")) {
8585+ throw new Error(INVALID_SIGNING_KEY_ERROR);
8686+ }
7787 this.#signingKey = ui8FromString(options.signingKey, "hex");
7878- this.auth = options.auth ?? ((did) => did === this.did);
8888+ if (this.#signingKey.byteLength !== 32) {
8989+ throw new Error(INVALID_SIGNING_KEY_ERROR);
9090+ }
79918092 this.db = new Database(options.dbPath ?? "labels.db");
8193 this.db.pragma("journal_mode = WAL");