{"id":13718955,"url":"https://github.com/bandoche/PyPinkSign","last_synced_at":"2025-05-07T10:34:09.237Z","repository":{"id":32652070,"uuid":"36239252","full_name":"bandoche/PyPinkSign","owner":"bandoche","description":"PinkSign – a friendly Python library for NPKI (공동인증서, 구 공인인증서) certificates 🔑","archived":false,"fork":false,"pushed_at":"2025-04-30T03:20:38.000Z","size":218,"stargazers_count":107,"open_issues_count":0,"forks_count":30,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-30T04:24:50.246Z","etag":null,"topics":["cryptography","kpki-certificates","npki","pfx","pkcs","pkcs1","pyasn1","python","sign"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bandoche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-25T15:39:09.000Z","updated_at":"2025-04-30T03:20:42.000Z","dependencies_parsed_at":"2024-01-06T00:02:58.615Z","dependency_job_id":"8f4c12a7-6df5-43de-9ee7-943ae5bbb4eb","html_url":"https://github.com/bandoche/PyPinkSign","commit_stats":{"total_commits":146,"total_committers":6,"mean_commits":"24.333333333333332","dds":"0.13013698630136983","last_synced_commit":"5ffed9cfed9f68f42cf5a248d482afa31dcdfccd"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bandoche%2FPyPinkSign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bandoche%2FPyPinkSign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bandoche%2FPyPinkSign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bandoche%2FPyPinkSign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bandoche","download_url":"https://codeload.github.com/bandoche/PyPinkSign/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251642481,"owners_count":21620313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","kpki-certificates","npki","pfx","pkcs","pkcs1","pyasn1","python","sign"],"created_at":"2024-08-03T01:00:39.959Z","updated_at":"2025-05-07T10:34:09.223Z","avatar_url":"https://github.com/bandoche.png","language":"Python","funding_links":[],"categories":["\u003e 0 ⭐️"],"sub_categories":[],"readme":"# PyPinkSign\nPython code for PKI certificate. 공인인증서(공동인증서)를 다루는 파이썬 코드입니다.\n\n## Status\n[![Build](https://github.com/bandoche/PyPinkSign/actions/workflows/python-package.yml/badge.svg)](https://circleci.com/gh/bandoche/PyPinkSign) [![codecov](https://codecov.io/gh/bandoche/PyPinkSign/branch/master/graph/badge.svg)](https://codecov.io/gh/bandoche/PyPinkSign) [![](https://dcbadge.limes.pink/api/server/https://discord.gg/9HGAzAzBg3?style=plastic)](https://discord.gg/9HGAzAzBg3)\n\n## Support method\n- Load personal purpose of PKI a.k.a \"NPKI\" or \"[공동인증서 (formerly 공인인증서)](http://www.rootca.or.kr/kor/accredited/accredited03_05.jsp)\"\n- Encrypt, Decrypt, Sign, Verify (part of Public-key cryptography)\n- Get Details (Valid date, Serial number, CN)\n- PKCS#7 sign\n\n## Usage example\n\nLoad public key file and private key file.\n\n```python\nimport pypinksign\np = pypinksign.PinkSign()\np.load_pubkey(pubkey_path=\"/path/signCert.der\")\np.load_prikey(prikey_path=\"/path/signPri.key\", prikey_password=b\"my-0wn-S3cret\")\nsign = p.sign(b'1') \nverify = p.verify(sign, b'1')  # True\n```\n\nLoad specific certificate. (by CN)\n\n```python\nimport pypinksign\n\n# choose_cert function automatically fetch path for certificates\n# and load certificate which match CN and passpharase for Private Key\np = pypinksign.choose_cert(cn=\"홍길순\", pw=b\"i-am-h0ng\")\nsign = p.sign(b'1') \nverify = p.verify(sign, b'1')  # True\nenvelop = p.pkcs7_signed_msg(b'message')  # PKCS7 signed with K-PKI\n```\n\nLoad PFX(p12) certificate.\n\n```python\nimport pypinksign\n\n# choose_cert function automatically fetch path for certificates\n# and load certificate which match DN and passpharase for Private Key\np = pypinksign.PinkSign(p12_path=\"홍길순.pfx\", prikey_password=b\"i-am-h0ng\")\nsign = p.sign(b'1') \nverify = p.verify(sign, b'1')  # True\nenvelop = p.pkcs7_enveloped_msg(b'message')  # Envelop with K-PKI - Temporary removed\n```\n\n\n## Requirement \u0026 Dependency\n- Python 3.8 or above\n- [PyASN1](http://pyasn1.sourceforge.net) for pyasn1\n- [cryptography](https://cryptography.io/en/latest/) for cryptography.hazmat\n- OpenSSL 1.1.1 or above due to cryptography package\n\n## Installation\n\nThe easiest way to get PyPinkSign is pip\n\n\tpip install pypinksign\n\nThe current development version can be found at \n[http://github.com/bandoche/pypinksign/tarball/main](http://github.com/bandoche/pypinksign/tarball/main)\n\n\n\n## Changelog\n\n### v0.5.3 (2025-02-22)\n- Update dependency (`cryptography==44.0.1`) to resolves multiple vulnerabilities.\n- Update dependency (`pyasn1==0.6.1`) to support recent python versions.\n- Update cryptography deprecations (move SEED algo, use not_valid_before/after_utc) (thanks to [kerokim](https://github.com/kerokim))\n- Drop Python 3.7 support \n\n### v0.5.2 (2024-12-21)\n- Update dependency (`cryptography==42.0.8`) to resolves multiple vulnerabilities.\n\n### v0.5.1 (2022-11-02)\n- Update dependency (`cryptography==38.0.3`) which resolves CVE-2022-3602 and CVE-2022-3786\n\n### v0.5.0 (2022-01-18)\n- Upgrade dependency (`cryptography==36.0.1`)\n- Fix file handle leakage\n\n### v0.4.5 (2020-12-03)\n- Fix import path issue (thanks to [Gyong1211](https://github.com/Gyong1211))\n\n### v0.4.4 (2020-12-03)\n- Fix CRT related param error\n- Remove PyOpenSSL dependency\n- Remove old OpenSSL version dependency with pure SEED implementation.\n  - If SEED algorithm is not supported by local OpenSSL, use python version of SEED algorithm automatically.\n\n### v0.4.3 (2020-02-26)\n- Fix seed_generator to generate bytes \n\n### v0.4.2 (2020-02-26)\n- Test code fix\n\n### v0.4.1 (2020-02-26)\n- Add PKCS7 sign message.\n\n### v0.4 (2020-02-26)\n- Drop Python 2 support. \n- Support Python 3.6 or above.\n- Add type hinting.\n- Add test code.\n- Add PBKDF2 for support PBES2 private key. (by [yongminz])\n- Add function to inject `r` (rand num) value to private key. \n- Update `pyasn1` to `0.4.8`\n- Update `cryptography` to `2.8`\n- Update `pyOpenSSL` to `19.1.0`\n- Temporary remove enveloping function.\n\n### v0.3 (2017-03-14)\n- Add support for PFX (PKCS 12).\n- Add `PyOpenSSL` module for PFX support.\n- Remove `PBKDF1` module.\n\n### v0.2.3 (2016-09-19)\n- Update `cryptography` dependency version to `1.5`.\n\n### v0.2.2 (2016-07-25)\n- You can load private key file from string.\n- Update Docstring format.\n\n### v0.2.1 (2016-06-23)\n- Bug fix.\n\n### v0.2 (2016-06-21)\n- Add function for get serial number of cert.\n- Remove README.rst in repository. \n\n### v0.1.1 (2015-06-07)\n- Add README.rst for PyPI.\n\n### v0.1 (2015-06-07)\n- First release.\n\n## Thanks to\n- [item4](https://github.com/item4)\n- [peio](https://github.com/peio) for [PBKDF1](https://github.com/peio/PBKDF/) code.\n- [youngminz](https://github.com/youngminz) for PBES2 support.\n- [Gyong1211](https://github.com/Gyong1211) for v0.4.5\n- [kerokim](https://github.com/kerokim) for v0.5.3\n\n## See also\n- [rootca.or.kr](http://rootca.or.kr/kor/standard/standard01A.jsp) - Technical Specification for K-PKI System\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbandoche%2FPyPinkSign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbandoche%2FPyPinkSign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbandoche%2FPyPinkSign/lists"}