Skip to main content

PSU Signer

Quick development for applying PSU digital signature using (Endensive)[https://github.com/m32/endesive].

Documents

https://documenter.getpostman.com/view/644041/2s93eU1tyD

Installation

pip install psusigner

Example

import datetime
from psusigner import PSUSigner


def main():
    fname = "file.pdf"
    date = datetime.datetime.utcnow()
    date = date.strftime("D:%Y%m%d%H%M%S+00'00'")
    dct = {
        "sigflags": 3,
        "contact": "user@psu.ac.th",
        "location": "Hat Yai, Thailand",
        "signingdate": date.encode(),
        "reason": "Test",
        "attrs": False,
    }

    print("Secret Sign")
    signer = PSUSigner(
        code="c1",
        secret="",
        agent_key="",
        api_url="https://ds-dev.psu.ac.th/api/v1", # change it to use production url or remove it for using default api url
    )

    outname = fname.replace(".pdf", "-signed-cms-psuhsm.pdf")

    signer.sign_file(fname, dct, outname)

    print("JWT Sign")
    signer = PSUSigner(
        code="c1",
        secret="",
        agent_key="",
        jwt_secret="",
        api_url="https://ds-dev.psu.ac.th/api/v1",  # change it to use production url or remove it for using default api url

    )

    outname = fname.replace(".pdf", "-signed-cms-psuhsm-jwt.pdf")

    signer.sign_file(fname, dct, outname)

    search_response = signer.search(certEntryCode="c1")
    print("search output:", search_response)


main()

Metadata

Release files for psusigner 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psusigner 0.1.9
File Size Uploaded Provenance Actions
psusigner-0.1.9.tar.gz 5.5 kB Without provenance Details for psusigner-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for psusigner 0.1.9
File Interpreter ABI Platform Actions
psusigner-0.1.9-py3-none-any.whl Python 3 none any Details for psusigner-0.1.9-py3-none-any.whl

Total release size: 12.2 kB

Release files / psusigner-0.1.9.tar.gz

Download URL psusigner-0.1.9.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
133d13620746d9fc9645e61025a2220d8817d405ec186992c26963f954052ffb
BLAKE2b-256 checksum
How to use checksums
46007bf464e1de0402aee970fae166bb66b0ba78f7f6f6a68d02b6d1de92aec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.9 Linux/6.7.9-amd64

Release files / psusigner-0.1.9-py3-none-any.whl

Download URL psusigner-0.1.9-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e17c06807a26167b6a4a13756ca9a2556e95cd89b84330dbad3f7201e043ccdf
BLAKE2b-256 checksum
How to use checksums
2e4a722442cc64b01ed1346248f292f93cb198a8941c6d5fbce5d786ea86d08e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.9 Linux/6.7.9-amd64

Security for psusigner 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page