Skip to main content

Useful functions for working with IEEE 2030.5 (SEP2)

Project description

SEP2-Tools

This library provides some useful functions for working with IEEE 2030.5 (SEP2).

Install

pip install sep2tools

Certificate Inspection

Get the LFDI for a certificate. It will also do some validation checks.

python -m sep2tools cert-lfdi certs/dev-ABC-cert.pem

Helper Functions

Generating IDs

from sep2tools.ids import generate_mrid

EXAMPLE_PEN = 1234
mrid = generate_mrid(EXAMPLE_PEN)
print(mrid)  # 2726-D70C-C6C2-40DB-B78E-9B38-0000-1234

Bitmap Hex Mappings

Some helper functions are provided for calculating the hex representation of SEP2 bitmap fields.

from sep2tools.hexmaps import get_role_flag

binval, hexval = get_role_flag(is_mirror=1, is_der=1, is_submeter=1)
print(binval)  # 0000000001001001
print(hexval)  # 0049

Certificate Creation

Note the below CLI commands are only appropriate for testing purposes. For production certificates, additional functions and policies may be required.

Signing Certificates

Create a SERCA, and a MICA.

python -m sep2tools create-serca
python -m sep2tools create-mica certs/serca.pem certs/serca.key

Device Certificates

To create a device certificate, first create a Key and Certificate Signing Request (CSR).

python -m sep2tools create-key --key-file certs/dev-ABC.key

Once you have the CSR, build the cert by signing with the MICA.

python -m sep2tools create-cert certs/dev-ABC.csr certs/mica.pem certs/mica.key --pen 12345 --serno ABC

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sep2tools-0.3.3.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sep2tools-0.3.3-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file sep2tools-0.3.3.tar.gz.

File metadata

  • Download URL: sep2tools-0.3.3.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sep2tools-0.3.3.tar.gz
Algorithm Hash digest
SHA256 b4c1baebc483ea37f5dceb37e9349f8a8ff3148934491a9a6df8449a1bad7cae
MD5 3eca5bd838675d4ee612499255e79ce4
BLAKE2b-256 b5e9ee8553cc9d04fdb2b92bc08a4414b16281bc21dde12934d8835e4e8e78ad

See more details on using hashes here.

File details

Details for the file sep2tools-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: sep2tools-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for sep2tools-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f94eff2842be3f508ecc08fa651a1639fcbcec76005034483b1df0be120a3cd2
MD5 66e33f1daf64fb190be8bd1c2542c89e
BLAKE2b-256 f2c7146099a26b9e0216ea4dc8bc56dad85eb7264380c594e3722cc0b2288fae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page