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.1.tar.gz (24.4 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.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sep2tools-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1481fdfa35d9c0b2f7f7c9fce5a4a0a1935a285d7aed0c4a4dd50bf6e82fcc5d
MD5 bf946e7f2484a80edf754197006b8d55
BLAKE2b-256 103c1ec49f9f8fa68f9ee561e78da0c0c8fa5d9ff43b1be82ecdb5eb100ce636

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sep2tools-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb3aca5ea40f3d5cfab734b5d1bf38e88d2581ab3df5b8baf665cafc55c114c7
MD5 1896076dfa722b55e693f9706b36151e
BLAKE2b-256 ef0c4c18edb1342b3023ac64c6c7039f8822f30c5749368487d1de3f8c5de4af

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