Skip to main content

STIR/SHAKEN Toolkit

Reusable Python tooling for STIR/SHAKEN certificate work:

  • Local utilities for CSRs, fingerprints, certificate inspection/validation, and STI-PA SPC tokens.
  • A PeeringHub ACME workflow for issuing STIR/SHAKEN certificates.
  • Python modules that can be reused by higher-level automation.

The package is split into three layers:

  • acme_core: provider-neutral RFC 8555 ACME primitives.
  • stir_shaken_acme: STIR/SHAKEN-specific TNAuthList, STI-PA, CSR, fingerprint, issuance, and inspection/validation helpers.
  • stir_shaken_toolkit.providers.peeringhub: PeeringHub profile defaults and issuance convenience APIs.

Install

pip install stir-shaken-toolkit

Quick Start

Most operators using PeeringHub need four groups of values:

  • STI-PA credentials: STIPA_USER_ID, STIPA_PASSWORD, and STIPA_SP_ID.
  • The service provider code: STIPA_SPC.
  • The PeeringHub ACME key identifier, when PeeringHub provides one: ACME_KID.
  • X.509 subject details such as organization, state, locality, and country.

Values can be supplied as CLI arguments, YAML config, or environment variables. For repeated use, a config file or environment variables are usually less noisy than long command lines.

export STIPA_USER_ID=sti-pa-user
export STIPA_PASSWORD=sti-pa-password
export STIPA_SP_ID=818H
export STIPA_SPC=818H
export ACME_KID=peeringhub-kid
export SHAKEN_SUBJECT_ORGANIZATION="Example Telecom"
export SHAKEN_SUBJECT_STATE=TX
export SHAKEN_SUBJECT_LOCALITY=Irving

Prepare or verify the PeeringHub ACME account:

stir-shaken-toolkit peeringhub-account-setup

Issue a certificate:

stir-shaken-toolkit peeringhub-issue

By default, issuance writes artifacts to a new timestamped directory such as ./shaken-cert-20260508T162900Z.

peeringhub-account-setup and peeringhub-issue contact PeeringHub ACME. peeringhub-issue also contacts STI-PA.

Common Commands

PeeringHub issuance:

stir-shaken-toolkit peeringhub-account-setup
stir-shaken-toolkit peeringhub-issue

Local CSR and fingerprint utilities:

stir-shaken-toolkit csr --spc 818H
stir-shaken-toolkit inspect --csr shaken.csr
stir-shaken-toolkit inspect --certificate leaf.pem --json
stir-shaken-toolkit fingerprint --csr shaken.csr
stir-shaken-toolkit validate-key-pair --key account.key --certificate leaf.pem
stir-shaken-toolkit validate-key-pair --key shaken.key --csr shaken.csr

Standalone STI-PA SPC token request:

stir-shaken-toolkit spc-token \
  --spc 818H \
  --fingerprint "SHA256 AA:BB:..."

List STI-PA STI-CA companies:

stir-shaken-toolkit ca-list
stir-shaken-toolkit ca-list --json --details

Run stir-shaken-toolkit --help or stir-shaken-toolkit <command> --help for the current command-line reference.

Configuration Basics

CLI values resolve in this order:

  1. Explicit command-line arguments.
  2. --config YAML values.
  3. Prefixed environment variables.
  4. Built-in defaults.

Environment variables use domain prefixes: STIPA_*, ACME_*, SHAKEN_*, and PEERINGHUB_*.

--config is a global option, so place it before the subcommand:

stir-shaken-toolkit --config toolkit.yaml peeringhub-issue

See Configuration for the complete config and environment variable reference.

Important Files

PeeringHub ACME commands use a local account directory. If you do not configure one, the toolkit chooses a per-user platform default.

The durable credential is account.key. Protect it like any other private key. PeeringHub issuance uses this key for ACME account authentication, the STI-PA SPC token fingerprint, the CSR public key, and the final certificate/private-key pair.

The account.json file is a recoverable cache of the PeeringHub ACME account URL. If it is removed, the toolkit can recreate it by signing with the existing account.key.

PeeringHub issuance writes certificate artifacts but does not write a private key into the issuance output directory. The issued certificate belongs with the ACME account key.

For installation and publication details, see Artifacts and Installation.

More Documentation

Release files for stir-shaken-toolkit 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stir-shaken-toolkit 1.0.2
File Size Uploaded
stir_shaken_toolkit-1.0.2.tar.gz 50.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stir-shaken-toolkit 1.0.2
File Interpreter ABI Platform
stir_shaken_toolkit-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 101.6 kB

Release files / stir_shaken_toolkit-1.0.2.tar.gz

Download URL stir_shaken_toolkit-1.0.2.tar.gz
Size 50.2 kB
Tags Source
SHA-256 checksum
How to use checksums
0e0e52698ac8b02ab71909868e5880a8d0c65fd163746e69b27d076f6f8dc565
BLAKE2b-256 checksum
How to use checksums
c8bdaa2761af7ddd885208f1413a325895f5a9ef6a4ac3ad723a8794681f0afa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release files / stir_shaken_toolkit-1.0.2-py3-none-any.whl

Download URL stir_shaken_toolkit-1.0.2-py3-none-any.whl
Size 51.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f6531d7a41b3de0f7b930cf195e68f0882af2a6aba8977f52e5cd5467afe2d3
BLAKE2b-256 checksum
How to use checksums
4ece8dbf269869eb51e5fbb91a3df598049a11b19fba58f2bed6bd81a66c4d55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 16, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page