Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Basic NPKI module.

Project description

PyPinkSign
==========

Small python code for K-PKI certificates. 공인인증서를 다루는 파이선
코드입니다.

Support method
--------------

- Load personal purpose of
`NPKI <http://www.nsic.go.kr/ndsi/help/pki.do?menuId=MN050503>`__
a.k.a
"`공인인증서 <http://www.rootca.or.kr/kor/accredited/accredited03_05.jsp>`__\ "
- Encrypt, Decrypt, Sign, Verify (part of Public-key cryptography)
- PKCS#7 sign, envelop

Usage example
-------------

.. code:: python

import pypinksign
p = pypinksign.PinkSign()
p.load_pubkey(pubkey_path="/path/signCert.der")
p.load_prikey(prikey_path="/path/signPri.key", prikey_password="my-0wn-S3cret")
sign = p.sign('1')
verify = p.verify(sign, '1') # True

.. code:: python

import pypinksign

# choose_cert function automatically fetch path for certificates
# and load certificate which match DN and passpharase for Private Key
p = pypinksign.choose_cert(dn="홍길순", pw="i-am-h0ng")
sign = p.sign('1')
verify = p.verify(sign, '1') # True
envelop = p.envelop_with_sign_msg('message') # Envelop with K-PKI

Requirement & Dependency
------------------------

- Python 2.7 (Probably works with python 3 and above, but not tested)
- `PyCrypto <https://pypi.python.org/pypi/pycrypto>`__ for
Crypto.PublicKey
- `python-pkcs1 <https://github.com/bdauvergne/python-pkcs1>`__ for
pkcs1
- `PyASN1 <http://pyasn1.sourceforge.net>`__ for pyasn1
- `cryptography <https://cryptography.io/en/latest/>`__ for
cryptography.hazmat
- `bitarray <https://pypi.python.org/pypi/bitarray/>`__ 0.8.1 for
bitarray.bitarray

Installation
------------

The easiest way to get skeleton is if you have setuptools / distribute
*or* pip installed

::

easy_install pypinksign

or

::

pip install pypinksign

The current development version can be found at
`http://github.com/bandoche/pypinksign/tarball/master <>`__

History
-------

Ver. 0.1.1
~~~~~~~~~~

- Add README.rst for PyPI

Ver. 0.1
~~~~~~~~

- First release.

See also
--------

- `rootca.or.kr <http://rootca.or.kr/kor/standard/standard01A.jsp>`__ -
Technical Specification for K-PKI System

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pypinksign, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size pypinksign-0.1-py2.7.egg (13.4 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size pypinksign-0.1.tar.gz (6.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page