> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuro-tech.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Building packages

> How to generate and sign a Neuron package file

There are two types of packages:

* **Content only** — contain content files like Markdown, scripts, and JavaScript
* **Assembly packages** — can install C# assembly files, extending Neuron capabilities

Content only packages do not require a Neuron restart. Assembly packages do.

## Prerequisites

To create a package file you need:

* All package contents in a folder (a content folder or a Dotnet project output folder)
* A `.manifest` file describing all package content — only listed files are shipped
* Encryption keys to encrypt and sign the package
* [`Waher.Utility.Install`](https://github.com/PeterWaher/IoTGateway/tree/master/Utilities/Waher.Utility.Install) and [`Waher.Utility.Sign`](https://github.com/PeterWaher/IoTGateway/tree/master/Utilities/Waher.Utility.Sign) — available by installing the Neuron or building from the [IoTGateway](https://github.com/PeterWaher/IoTGateway) repo

You can follow along with the [Example Package](https://github.com/Trust-Anchor-Group/NeuronExamplePackage).

## Steps

1. Write the package code to a functional state
2. Generate the `.package` file
3. Sign the `.package` file, generating a `.signature` file

Then install on a Neuron with `Waher.Utility.Install` or the Neuron admin dashboard.

## Generating the necessary keys

We recommend Ed448 for signatures and AES-256 for encryption. If you have access to a Neuron, use this script in the script console:

```text theme={null}
Key:=Ed448();
printline("PubKey: "+Base64Encode(Key.PublicKey));
printline("PrivKey: "+select /default:EllipticCurve/@d from Xml(Key.Export()));
printline("AES key: "+Hashes.BinaryToString(Waher.IoTGateway.Gateway.NextBytes(16)));
```

## Generating the .package file

Use `Waher.Utility.Install.exe` with these flags:

* `-p PACKAGE_NAME.package`
* `-k AES_KEY`
* `-m MANIFEST_FILE`

If you installed the Neuron using the installer, find `Waher.Utility.Install` at `C:\Program Files (x86)\Neuron\InstallUtility`.

After running this command you will have a `PACKAGE_NAME.package` file in the active folder.

## Signing the package

To generate the `.signature` file, use `Waher.Utility.Sign.exe` with these flags:

* `-c ed448`
* `-priv PRIVATE_KEY`
* `-o PACKAGE_NAME.signature`
* `-s PACKAGE_NAME.package`

Find `Waher.Utility.Sign` at `C:\Program Files (x86)\Neuron` if installed via the installer.

After this you are ready to distribute the package.
