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 Creation

Note the below CLI commands are only appropriate for testing purposes. For production certificates, use the actual functions to set appropriate policies and settings.

Create a SERCA, and a MICA.

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

To create a device certificate, first create a Key and CSR. And then sign using the MICA.

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

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

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.0.tar.gz (24.1 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.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sep2tools-0.3.0.tar.gz
  • Upload date:
  • Size: 24.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for sep2tools-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7b215f87b2f26b190e783d936937738f65576d3117161e74abc14049b9ca9490
MD5 43dddecfd1c3107314d9edb16e448da9
BLAKE2b-256 cbc064af26ac33d28984fff8af2f31dccb9f2cea6e09a072f074671a3efc2024

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sep2tools-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for sep2tools-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b38b5da486ed70bfa02a7192c0847a3d0d627a1fca3e183db9fc6b15146b538c
MD5 f71d93ff1a22f3add1316f7e316d439e
BLAKE2b-256 a1d4c12ec9b34daad38f61bb7188e24434d3e7262d698bf2d8fe58fb1e248d5c

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