CryptoSys Home > PKI > Python CryptoSys PKI Cross Reference

Python CryptoSys PKI Cross Reference


A list of all the classes and functions in Python for CryptoSys PKI with a cross reference to the corresponding PKI core function in the main manual. Check the link to the PKI core function for more detailed information on the underlying behaviour. All methods are static methods. See also the full cryptosyspki Python documentation.

ClassMethodPKI FunctionDescription
Asn1 -- Utilities to analyze ASN.1 files.
 typeASN1_TypeDescribe the type of ASN.1 data.
 text_dumpASN1_TextDumpDump details of an ASN.1 formatted data file to a text file.
 text_dump_tostringASN1_TextDumpToStringDump details of an ASN.1 formatted data file to a string.
Cipher -- Generic block cipher functions.
 blockbytesn/aReturn the block size in bytes for a given cipher algorithm.
 keybytesn/aReturn the key size in bytes for a given cipher algorithm.
 encryptCIPHER_EncryptBytesEncrypt data.
 decryptCIPHER_DecryptBytesDecrypt data.
 encrypt_hexCIPHER_EncryptHexEncrypt data hex-encoded data using hex-encoded parameters.
 decrypt_hexCIPHER_DecryptHexDecrypt hex-encoded data using hex-encoded parameters.
 encrypt_blockCIPHER_EncryptBytesEncrypt a block of data. Must be an exact multiple of block length.
 decrypt_blockCIPHER_DecryptBytesDecrypt a block of data. Must be an exact multiple of block length.
 file_encryptCIPHER_FileEncryptEncrypt a file.
 file_decryptCIPHER_FileDecryptDecrypt a file.
 key_wrapCIPHER_KeyWrapWrap (encrypt) key material with a key-encryption key.
 key_unwrapCIPHER_KeyUnwrapUnwrap (decrypt) key material with a key-encryption key.
 padPAD_BytesBlockPad byte array to correct length for ECB and CBC encryption.
 pad_hexPAD_HexBlockPad hex-encoded string to correct length for ECB and CBC encryption.
 unpadPAD_UnpadBytesRemove padding from an encryption block.
 unpad_hexPAD_UnpadHexRemove the padding from a hex-encoded encryption block.
 encrypt_aeadCIPHER_EncryptAEADEncrypt data using the AES-GCM authenticated encryption algorithm.
 decrypt_aeadCIPHER_DecryptAEADDecrypt data using the AES-GCM authenticated encryption algorithm.
Cms -- Create, read and analyze Cryptographic Message Syntax (CMS) objects.
 make_envdataCMS_MakeEnvDataCreate a CMS enveloped-data object [file --> file].
 make_envdata_from_stringCMS_MakeEnvDataFromStringCreate a CMS enveloped-data object [string --> file].
 make_envdata_from_bytesCMS_MakeEnvDataFromBytesCreate a CMS enveloped-data object [bytes --> file].
 read_envdata_to_fileCMS_ReadEnvDataRead and decrypt CMS enveloped-data object using the recipient's private key.
 read_envdata_to_stringCMS_ReadEnvDataToStringRead and decrypt CMS enveloped-data object using the recipient's private key [file --> string] (expects output to be UTF-8-encoded text).
 read_envdata_to_bytesCMS_ReadEnvDataToBytesRead and decrypt CMS enveloped-data object using the recipient's private key [file --> bytes].
 make_sigdataCMS_MakeSigDataCreate a CMS signed-data object from a data file using user's private key [file --> file].
 make_sigdata_from_stringCMS_MakeSigDataFromBytesCreate a CMS signed-data object from a string using user's private key [string --> file].
 make_sigdata_from_bytesCMS_MakeSigDataFromBytesCreate a CMS signed-data object from data using user's private key [bytes --> file].
 make_sigdata_from_sigvalueCMS_MakeSigDataFromSigValueCreate a CMS object of type SignedData using a pre-computed signature value [bytes --> file].
 make_sigdata_from_pseudoCMS_MakeSigDataFromSigValueCreate a SignedData object from a "pseudo" object.
 make_detached_sigCMS_MakeDetachedSigCreate a "detached signature" CMS signed-data object from a message digest of the content [hexdigest --> file].
 read_sigdata_to_fileCMS_ReadSigDataRead the content from a CMS signed-data object file [file --> file].
 read_sigdata_to_stringCMS_ReadSigDataToStringRead the content from a CMS signed-data object file directly into a string [file --> string] (expects output to be UTF-8-encoded text).
 read_sigdata_to_bytesCMS_ReadSigDataToBytesRead the content from a CMS signed-data object file into bytes.
 verify_sigdataCMS_VerifySigDataVerify the signature and content of a signed-data CMS object file.
 query_sigdataCMS_QuerySigDataQuery a CMS signed-data object file for selected information. May return an integer or a string.
 query_envdataCMS_QueryEnvDataQuery a CMS enveloped-data object file for selected information. May return an integer or a string.
 make_comprdataCMS_MakeComprDataCreate a new CMS compressed-data file (.p7z) from an existing input file.
 read_comprdataCMS_ReadComprDataRead and extract the decompressed contents of a CMS compressed-data file [binary file --> binary file].
Cnv -- Character conversion routines.
 tohexCNV_HexStrFromBytes Encode binary data as a hexadecimal string.
 fromhexCNV_BytesFromHexStrDecode a hexadecimal-encoded string into a byte array.
 tobase64CNV_B64StrFromBytesEncode binary data as a base64 string.
 frombase64CNV_BytesFromB64StrDecode a base64-encoded string into a byte array.
 tobase58CNV_Base58FromBytesEncode binary data as a base58 string.
 frombase58CNV_Base58ToBytesDecode a base58-encoded string into a byte array.
 reverse_bytesCNV_ReverseBytesReverse the order of a byte array.
 num_from_bytesCNV_NumFromBytesConvert the leftmost four bytes of an array to a 32-bit integer.
 num_to_bytesCNV_NumToBytesConvert a 32-bit integer to an array of 4 bytes.
 utf8_checkCNV_CheckUTF8BytesCheck if a byte array or string contains valid UTF-8 characters. Returns integer code.
 utf8_check_fileCNV_CheckUTF8FileCheck if a file contains valid UTF-8 characters. Returns integer code.
 utf8_check_to_stringn/aReturn a string describing an integer code returned by Cnv.utf8_check and Cnv.utf8_check_file.
 shortpathnameCNV_ShortPathNameRetrieve the Windows short path form of the specified path.
Compr -- Compression utilities.
 compressCOMPR_CompressCompress data using zlib compression.
 uncompressCOMPR_UncompressUncompress data using zlib compression.
Ecc -- Manage keys for elliptic curve cryptography.
 make_keysECC_MakeKeysGenerate a new EC public/private key pair and save as two key files.
 read_private_keyECC_ReadPrivateKeyRead from a file or string containing an EC private key into an "internal" private key string.
 read_public_keyECC_ReadPublicKeyRead from a file or string containing an EC public key into an "internal" public key string.
 read_key_by_curveECC_ReadKeyByCurveReturn an internal key string of an EC key from its hexadecimal representation.
 query_keyECC_QueryKeyQuery an EC key string for selected information. May return an integer or a string.
 save_keyECC_SaveKeySave an internal EC key string (public or private) to an unencrypted key file.
 save_enc_keyECC_SaveEncKeySave an internal EC private key string to an encrypted private key file.
 publickey_from_privateECC_PublicKeyFromPrivateReturn an internal EC public key string from an internal EC private key string.
 key_hashcodeECC_KeyHashCodeCompute the hash code of an "internal" ECC public or private key string.
 dh_shared_secretECC_DHSharedSecretCompute EC Diffie-Hellman shared secret.
Gen -- General info about the core DLL and errors returned by it.
 versionPKI_VersionReturn the release version of the core CryptoSys PKI DLL as an integer value.
 compile_timePKI_CompileTimeReturn date and time the core CryptoSys PKI DLL was last compiled.
 module_namePKI_ModuleNameReturn full path name of the current process's DLL module.
 module_infoPKI_ModuleInfoGet additional information about the core DLL module.
 core_platformPKI_PlatformReturn the platform the core DLL was compiled for ('Win32' or 'X64').
 licence_typePKI_LicenceTypeReturn licence type: "D"=Developer "T"=Trial.
 last_errorPKI_LastErrorReturn the last error message set by the toolkit, if any.
 error_lookupPKI_ErrorLookupReturn a description of an error code.
 error_codePKI_ErrorCodeReturn the error code of the *first* error that occurred when calling the last function.
Hash -- Compute message digest hash values.
 lengthHASH_LengthReturn length of message digest output in bytes.
 dataHASH_BytesCompute message digest as a byte array from bytes data.
 fileHASH_FileCompute message digest as a byte array from data in a file.
 hex_from_dataHASH_HexFromBytesCompute message digest in hexadecimal format from bytes data.
 hex_from_stringn/aCompute message digest in hexadecimal format from a string.
 hex_from_fileHASH_HexFromFileCompute message digest in hexadecimal format from data in a file.
 hex_from_hexHASH_HexFromHexCompute message digest in hexadecimal format from data in a hexadecimal-encoded string.
 doubleHASH_BytesCreate a double hash - hash of hash - as a byte array from bytes data.
Hmac -- Compute keyed-hash based message authentication code (HMAC) values.
 dataHMAC_BytesCompute a keyed-hash based message authentication code (HMAC) as a byte array from bytes data.
 hex_from_dataHMAC_HexFromBytesCompute a keyed-hash based message authentication code (HMAC) in hexadecimal format from bytes data.
 hex_from_stringn/aCompute a keyed-hash based message authentication code (HMAC) in hexadecimal format from string data.
 hex_from_hexHMAC_HexFromHexCompute a keyed-hash based message authentication code (HMAC) in hex format from data in hex-encoded strings.
Hpke -- Hybrid Public Key Encryption (HPKE) functions.
 labeled_expandHPKE_LabeledExpandCompute the output of the LabeledExpand function as defined in RFC9180.
 labeled_extractHPKE_LabeledExtractCompute the output of the LabeledExtract function as defined in RFC9180.
 derive_private_keyHPKE_DerivePrivateKeyDerive an EC private key in a deterministic manner from input keying material using the DeriveKeyPair algorithm in RFC9180.
Kdf -- Key Derivation Functions.
 bytesKDF_BytesGenerate a key-encryption key (KEK) from input keying material using a key derivation function (KDF).
 for_cmsKDF_ForCmsGenerate a key-encryption key (KEK) for ECDH key exchange in a CMS EnvelopedData object.
Ocsp -- Online Certificate Status Protocol (OCSP) routines.
 make_requestOCSP_MakeRequestCreate an Online Certification Status Protocol (OCSP) request as a base64 string.
 read_responseOCSP_ReadResponseRead a response to an Online Certification Status Protocol (OCSP) request and outputs the main results in text form.
Pbe -- Password-based encryption.
 kdf2PBE_Kdf2Derive a key of any length from a password using the PBKDF2 algorithm.
 scryptPBE_ScryptDerive a key of any length from a password using the SCRYPT algorithm from RFC7914.
Pem -- PEM file conversion routines.
 from_binfilePEM_FileFromBinFileExCreate a PEM file from a binary file.
 to_binfilePEM_FileToBinFileConvert the contents of a PEM file into a binary file.
Pfx -- PKCS-12 (PFX) file utilties.
 make_filePFX_MakeFileCreate a PFX (PKCS-12) file from an X.509 certificate and (optional) encrypted private key file.
 sig_is_validPFX_VerifySigDetermine if the MacData signature is valid in a pkcs-12 file.
Prf -- Pseudorandom function (PRF) Functions.
 bytesPRF_BytesGenerate output bytes using a pseudorandom function (PRF).
Pwd -- Password dialog utility.
 promptPWD_PromptExReturn a password entered into a dialog box.
Rng -- Random Number Generator to NIST SP800-90.
 bytestringRNG_BytesGenerate an array of n random bytes.
 numberRNG_NumberGenerate a random integer in a given range.
 octetRNG_NumberGenerate a single random octet (byte).
 initializeRNG_InitializeInitialize the RNG generator using a seed file.
 update_seedfileRNG_UpdateSeedFileUpdate the RNG seed file with more entropy.
 guidRNG_GuidGenerate a random 36-character Global Unique IDentifier (GUID) string according to [RFC4122].
Rsa -- RSA encryption and key management.
 make_keysRSA_MakeKeysXtdGenerate a new RSA public/private key pair.
 key_bitsRSA_KeyBitsReturn number of significant bits in RSA key modulus.
 key_bytesRSA_KeyBytesReturn number of bytes (octets) in RSA key modulus.
 key_hashcodeRSA_KeyHashCodeCompute the hash code of an "internal" RSA public or private key string.
 key_isprivateRSA_CheckKeyDetermine if keystring is a private key.
 key_valueRSA_KeyValueExtract a base64-encoded RSA key value from internal key string.
 key_matchRSA_KeyMatchDetermine if a pair of "internal" RSA private and public key strings are matched.
 publickey_from_privateRSA_PublicKeyFromPrivateReturn an internal RSA public key string from an internal RSA private key string.
 to_xmlstringRSA_ToXMLStringExReturn an XML string representation of an RSA internal key string.
 from_xmlstringRSA_FromXMLStringReturn an RSA key string in internal format from an XML string.
 read_private_keyRSA_ReadAnyPrivateKeyReturn an internal private key string from a file or string containing an RSA private key.
 read_public_keyRSA_ReadAnyPublicKeyReturn an internal public key string from a file or string containing an RSA public key.
 save_keyRSA_SavePrivateKeyInfoSave an internal RSA key string (public or private) to an unencrypted key file.
 save_enc_keyRSA_SaveEncKeySave an internal RSA private key string to an encrypted private key file.
 get_privatekey_from_pfxRSA_GetPrivateKeyFromPFXExtract an encrypted private key from a PKCS-12 PKCS8ShroudedKeyBag, saving the output directly as a new file.
 raw_privateRSA_RawPrivateReturn RSA transformation of block using private key.
 raw_publicRSA_RawPublicReturn RSA transformation of block using public key.
 encode_msg_for_signatureRSA_EncodeMsgCreate an encoded message for signature (EMSA-PKCS1-v1_5 only).
 decode_digest_for_signatureRSA_DecodeMsgExtract digest (or digestinfo) from an EMSA-PKCS1-v1_5-encoded block.
 encode_msg_for_encryptionRSA_EncodeMsgCreate an encoded message for encryption (EME).
 decode_msg_for_encryptionRSA_DecodeMsgExtract message from a PKCS#1 EME-encoded block.
 encryptRSA_EncryptEncrypt a short message using RSA encryption.
 decryptRSA_DecryptDecrypt a message encrypted using RSA encryption.
Sig -- Create and verify digital signatures.
 sign_dataSIG_SignDataCompute a signature value over data in a byte array.
 sign_digestSIG_SignDataCompute a signature value over a message digest value.
 sign_fileSIG_SignFileCompute a signature value over binary data in a file.
 data_is_verifiedSIG_VerifyDataVerify a signature value over data in a byte array.
 digest_is_verifiedSIG_VerifyDataVerify a signature value over a message digest value of data .
 file_is_verifiedSIG_VerifyFileVerify a signature value over data in a file.
Smime -- S/MIME entity utilities.
 wrapSMIME_WrapWrap a CMS object in an S/MIME entity.
 extractSMIME_ExtractExtract the body from an S/MIME entity.
 querySMIME_QueryQuery an S/MIME entity for selected information.
Wipe -- Wipe data securely.
 fileWIPE_FileSecurely wipe and delete a file.
 dataWIPE_DataZeroize data in memory.
X509 -- Create and manage X.509 certificates.
 make_certX509_MakeCertCreate an X.509 certificate using subject's public key and issuer's private key.
 make_cert_selfX509_MakeCertSelfCreate a self-signed X.509 certificate.
 cert_requestX509_CertRequestCreate a PKCS #10 certificate signing request (CSR).
 make_crlX509_MakeCRLCreate an X.509 Certificate Revocation List (CRL). Version 1 only.
 text_dumpX509_TextDumpDump details of X.509 certificate (or CRL or CSR) to a text file.
 text_dump_tostringX509_TextDumpToStringDump details of X.509 certificate (or CRL or CSR) to a string.
 query_certX509_QueryCertQuery an X.509 certificate file for selected information. May return an integer or a string.
 read_string_from_fileX509_ReadStringFromFileCreate a base64 string representation of an X.509 certificate.
 save_file_from_stringX509_SaveFileFromStringCreate an X.509 certificate file from its base64 string representation.
 key_usage_flagsX509_KeyUsageFlagsReturn a bitfield containing the keyUsage flags for an X.509 certificate.
 cert_thumbX509_CertThumbReturn the thumbprint (message digest hash) of an X.509 certificate.
 cert_hashissuersnX509_HashIssuerAndSNReturn the hash of the issuer and serial number.
 cert_is_valid_nowX509_CertIsValidNowVerify that an X.509 certificate is currently valid as per system clock.
 cert_is_revokedX509_CheckCertInCRLCheck whether an X.509 certificate has been revoked in a given Certificate Revocation List (CRL).
 cert_is_verifiedX509_VerifyCertVerify that an X.509 certificate has been signed by its issuer.
 cert_path_is_validX509_ValidatePathValidate a certificate path.
 get_cert_count_from_p7X509_GetCertCountInP7ChainReturn number of certificates in a PKCS-7 "certs-only" certificate chain file.
 get_cert_from_p7X509_GetCertFromP7ChainExtract an X.509 certificate from a PKCS-7 "certs-only" certificate chain file, saving the output directly as a new file.
 get_cert_from_pfxX509_GetCertFromPFXExtract an X.509 certificate from a PKCS-12 PFX/.p12 file, saving the output directly as a new file.
 get_p7chain_from_pfxX509_GetCertFromPFXExtract all X.509 certificates from a PKCS-12 PFX/.p12 file, saving the output directly as a new PKCS-7 "certs-only" certificate chain file.
 read_cert_string_from_p7chainX509_ReadCertStringFromP7ChainReads an X.509 certificate into a base64 string from PKCS-7 "certs-only" data.
 read_cert_string_from_pfxX509_ReadCertStringFromPFXRead an X.509 certificate into a base64 string from PKCS-12 PFX/.p12 data.
Xof -- Extendable-output function (XOF).
 bytesXOF_BytesGenerate bytes using an extendable-output function (XOF).

[Go to top]

Contact

For more information, please send us a message.

This page last updated 22 October 2023

[Go to top]