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.2.tar.gz (24.8 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.2-py3-none-any.whl (20.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sep2tools-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a7be61e5c5319dc665f75dfe6cb56e6662d2fb28964c90312c22964c65d67d92
MD5 bb019d5c9f21f0bf1b4e93e414096e4d
BLAKE2b-256 6f4817c8941b4281472d1aed7548bd7b05fd5fb6186dd142c089aa1a6e4b016a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for sep2tools-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3f0aa6c5f4476b5d0f1997c7aaf2c855f4d2c70e93c997af641ed8b886f1ee0a
MD5 73f59236faa5ac2173c4d4622c0db494
BLAKE2b-256 c427a902c09a0d41b654d1658985addaaee4abdb3620a8946b8dbb18afdd8aef

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