A package for generating signed certificates with issuer and subject information.
Project description
Signed Generator
A Python package for generating and handling signed verifiable credentials with merkle proof generation capabilities.
Installation
pip install -r requirements.txt
Features
- Generate and issue verifiable credentials
- Create and verify credential proofs
- Handle merkle proof generation
- Sign verifiable credentials
- Schema validation and management
- Attribute handling for credentials
Package Structure
signed_generator/
├── __init__.py
├── attribute.py
├── constants.py
├── credential_proof_handler.py
├── issue_certificate_gen.py
├── merkle_proof_gen.py
├── schema.py
├── sign_vc.py
├── signed_gen.py
├── utils.py
├── tests/
└── requirements.txt
Core Components
Credential Generation and Signing
signed_gen.py: Main module for generating signed credentialssign_vc.py: Handles the signing process for verifiable credentialsissue_certificate_gen.py: Manages certificate generation and issuance
Proof Generation and Handling
merkle_proof_gen.py: Generates merkle proofs for credentialscredential_proof_handler.py: Handles credential proof operations
Supporting Modules
schema.py: Defines and validates credential schemasattribute.py: Manages credential attributesutils.py: Utility functions for the packageconstants.py: Package-wide constants
Usage Example
from signed_generator import SignedCertGenerator, Issuer
issuer = Issuer(
name="Test Issuer",
website="https://issuer.example.com",
email="issuer@example.com",
did="did:example:123",
profile_link="https://issuer.example.com/profile",
revocation_list="https://issuer.example.com/revocation",
crypto_address="123abc"
)
# Initialize the generator
generator = SignedCertGenerator()
unsigned_json = "[{}]"
signed_cert_data = generator.generate_signed_cert_templated_data(
issuer=issuer,
unsigned_json=unsigned_json,
private_key="private_key",
valid_from="valid_from",
valid_until="valid_until",
)
# Create sign transaction hash
tx_hash = generator.generate_transaction(
issuer=issuer,
signed_cert_data=signed_cert_data,
gasprice=gasprice,
gaslimit=gaslimit,
unsigned_json=unsigned_json
)
# Create and sign a credential
signed_json = generator.generate_signed_certificate(
signed_cert_data=signed_cert_data,
tx_hash=tx_hash
)
print(signed_json)
Requirements
See requirements.txt for package dependencies.
Testing
The package includes a test suite in the tests/ directory. To run the tests:
python -m pytest tests/
License
[Add your license information here]
Contributing
[Add contribution guidelines here]
Contact
[Add contact information here]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file signedgen-1.0.0.tar.gz.
File metadata
- Download URL: signedgen-1.0.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f15ef59fa44d049b524463c630573a256996e84bd5d94b10a936802f7374416
|
|
| MD5 |
e6097c4f9a2ccb4318a0253a6af9e0c3
|
|
| BLAKE2b-256 |
d06df61b9bfb824bb7c0ba8d48aeace23b7fb11ad356912dce7ad1f104442108
|
File details
Details for the file signedgen-1.0.0-py3-none-any.whl.
File metadata
- Download URL: signedgen-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fd8e7f960502372ecaf2987eb0c1f088e4e0c580b735ea26d52d84628a3015b
|
|
| MD5 |
f1ef50ff929934ecd49db4f1d16c8ef6
|
|
| BLAKE2b-256 |
2613aaa3966df373490a8362f319badc01fd64c05933dcacc2b366499c240593
|