Home

Awesome

PyPinkSign

Python code for PKI certificate. 공인인증서(공동인증서)를 다루는 파이썬 코드입니다.

Status

CircleCI Build Status codecov

Support method

Usage example

Load public key file and private key file.

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

Load specific certificate. (by CN)

import pypinksign

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

Load PFX(p12) certificate.

import pypinksign

# choose_cert function automatically fetch path for certificates
# and load certificate which match DN and passpharase for Private Key
p = pypinksign.PinkSign(p12_path="홍길순.pfx", prikey_password=b"i-am-h0ng")
sign = p.sign(b'1') 
verify = p.verify(sign, b'1')  # True
envelop = p.pkcs7_enveloped_msg(b'message')  # Envelop with K-PKI - Temporary removed

Requirement & Dependency

Installation

The easiest way to get PyPinkSign is pip

pip install pypinksign

The current development version can be found at http://github.com/bandoche/pypinksign/tarball/main

History

Ver. 0.5.1 (2022-11-02)

Ver. 0.5.0 (2022-01-18)

Ver. 0.4.5 (2020-12-03)

Ver. 0.4.4 (2020-12-03)

Ver. 0.4.3 (2020-02-26)

Ver. 0.4.2 (2020-02-26)

Ver. 0.4.1 (2020-02-26)

Ver. 0.4 (2020-02-26)

Ver. 0.3 (2017-03-14)

Ver. 0.2.3 (2016-09-19)

Ver. 0.2.2 (2016-07-25)

Ver. 0.2.1 (2016-06-23)

Ver. 0.2 (2016-06-21)

Ver. 0.1.1 (2015-06-07)

Ver. 0.1 (2015-06-07)

Thanks to

See also