CryptoSys PKI Pro Manual

Using with Python

>>> from cryptosyspki import *
>>> Gen.version() # "hello world!" for CryptoSys PKI
200600
>>> Hash.hex_from_data(b'abc') # compute SHA-1 hash in hex of 'abc' as bytes
'a9993e364706816aba3e25717850c26c9cd0d89d'
>>> Hash.hex_from_string('abc', Hash.Alg.SHA256)   # same but over a string and using SHA-256
'ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad'
>>> h = Hash.data(b'abc')   # h is a byte array (bytes->bytes)
>>> print(Cnv.tohex(h))     # display the byte array in hex
A9993E364706816ABA3E25717850C26C9CD0D89D
More details on installation and usage at A Python interface to CryptoSys PKI Pro and Python CryptoSys PKI Cross Reference. To install the interface from PyPi
pip install cryptosyspki

[Contents] [Index]

[PREV: Combining bitwise options...]   [Contents]   [Index]   
   [NEXT: UTF-8 and Latin-1...]

Copyright © 2004-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-09-23T07:52:09Z.