Sign

Topic: sign

Explanation

protoparser sign <macro|pml> <file> <private_key.pem> <author> [key_id] creates a detached RSA-SHA256 signature file next to the target.

This works for both:

Examples:

The sidecar contains:

This keeps ProtoML source files clean and avoids adding extra inline signature syntax to the language itself.

Registry-backed workflow:

1. create or reuse an RSA private key 2. export the matching public key in PEM format 3. sign the macro file or the governance .pml file 4. publish the matching public key in the registry authors section 5. run verify or trust, either through the nearest project protoml.macros.json or with explicit -trustRegistry=...

Key bootstrap with OpenSSL:

Create a private key at a chosen export path:

openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072 -out "./keys/jane-director-private.pem"

Export the matching public key at a chosen path:

openssl rsa -pubout -in "./keys/jane-director-private.pem" -out "./keys/jane-director-public.pem"

Typical governance bootstrap:

Detached sidecar workflow outside a registry:

Author side:

User side:

Governance note:

If you want built-in macros to participate in the same trust model as external macros, they should also ship with detached *.sig.json files and a matching trusted author entry in a documented trust registry. Built-in bundled macros can also be trusted without a detached sidecar when they match the shipped built-in hash manifest and do not trigger hard risk flags, but that origin-based trust only applies to the known bundled files.

Examples

Full signing and verification flow:

protoparser sign macro "./macros/warn_box.pml" "./keys/alice-private.pem" "Alice" alice-main

Registry author entry:

{
  "name": "Alice",
  "trust": "trusted",
  "keys": [
    {
      "id": "alice-main",
      "public_key": "-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----"
    }
  ]
}

Verification:

protoparser verify macro "./macros/warn_box.pml" -trustRegistry="./my-registry"
protoparser trust "Meeting.pml" -trustRegistry="./my-registry"

Detached sidecar example without a registry:

Author:
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072 -out "./keys/alice-private.pem"
openssl rsa -pubout -in "./keys/alice-private.pem" -out "./keys/alice-public.pem"
protoparser sign macro "./shared/warn_box.pml" "./keys/alice-private.pem" "Alice" alice-main

Distribute together:
- ./shared/warn_box.pml
- ./shared/warn_box.pml.sig.json
- ./keys/alice-public.pem

User:
protoparser verify macro "./shared/warn_box.pml"

Short examples:

openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072 -out "./keys/alice-private.pem"
openssl rsa -pubout -in "./keys/alice-private.pem" -out "./keys/alice-public.pem"
protoparser sign macro "./macros/warn_box.pml" "./keys/alice-private.pem" "Alice" alice-main
protoparser sign pml "./meetings/board.pml" "./keys/alice-private.pem" "Alice" alice-main
protoparser verify pml "./meetings/board.pml" -trustRegistry="./authors-registry"