package crypto import ( "crypto/rand" "lux/proto" "github.com/google/uuid" ) type LuxKey struct { Type proto.LuxType Id uuid.UUID Key []byte } func (key *LuxKey) NewLuxKey(keyType proto.LuxType) error { key.Type = keyType key.Id = uuid.New() key.Key = make([]byte, 32) if _, err := rand.Read(key.Key); err != nil { return err } else { return nil } }