package license

import (
	"fmt"

	"github.com/hyperboloide/lk"
)

var trustedPublicKeys = []string{
	// Production signing key, generated 2026-07-24. Index 0 is current.
	"AS6Z4XBXF7HPTOMBUK47SWHPROAGOSBIW5ZZZHTLCA6FHMYSHCCTV3S6AIN6DOB6VKMHMTLRIWPSBAZ2FOHJV3A6NLOCWGEO2VA7KYGSG62SILEFA4SNJ7VWDDIVZZM4ZU4VJVE22LESH72STAAVIDYI77WA====",
}

func publicKeys() ([]*lk.PublicKey, error) {
	out := make([]*lk.PublicKey, 0, len(trustedPublicKeys))
	for i, s := range trustedPublicKeys {
		k, err := lk.PublicKeyFromB32String(s)
		if err != nil {
			return nil, fmt.Errorf("trusted public key %d is malformed: %w", i, err)
		}
		out = append(out, k)
	}
	return out, nil
}
