Module ImportFrom alias alias alias alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Assign NameStore ListLoad Str Str Str Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Str If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num attr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Str Str NameLoad attr Str Assign NameStore Call NameLoad GeneratorExp IfExp Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad comprehension NameStore NameLoad If CompareLt NameLoad TupleLoad Num Num Num body Raise Call NameLoad Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Str If CompareLt NameLoad TupleLoad Num body Expr Call AttributeLoad NameLoad attr Str orelse Expr Call AttributeLoad NameLoad attr Str
N/A __future__ unicode_literals division absolute_import print_function N/A re ctypes.util find_library _errors pretty_message _ffi LibraryNotFoundError FFIEngineError register_ffi N/A N/A cffi FFI N/A N/A N/A ImportError N/A N/A N/A FFIEngineError Error importing cffi N/A __all__ N/A libcrypto version version_info N/A ffi N/A FFI N/A N/A N/A ffi cdef const char *SSLeay_version(int type); N/A libcrypto_path N/A find_library crypto N/A N/A libcrypto_path N/A N/A N/A LibraryNotFoundError The library libcrypto could not be found N/A libcrypto N/A N/A ffi dlopen libcrypto_path N/A N/A register_ffi libcrypto ffi N/A version_string N/A N/A N/A N/A ffi string N/A N/A libcrypto SSLeay_version 0 decode utf-8 N/A version_match N/A N/A re search \b(\d\.\d\.\d[a-z]*)\b version_string N/A N/A version_match N/A N/A version_match N/A N/A re search (?<=LibreSSL )(\d\.\d(\.\d)?)\b version_string N/A N/A version_match N/A N/A N/A LibraryNotFoundError Error detecting the version of libcrypto N/A version N/A N/A version_match group 1 N/A version_parts N/A N/A N/A N/A re sub (\d)([a-z]+) \1.\2 version split . N/A version_info N/A tuple N/A N/A N/A N/A part isdigit N/A int part part N/A part version_parts N/A N/A version_info N/A 0 9 8 N/A N/A N/A LibraryNotFoundError N/A pretty_message 
        OpenSSL versions older than 0.9.8 are not supported - found version %s
         version N/A N/A N/A ffi cdef 
    typedef ... EVP_MD;
    typedef uintptr_t EVP_CIPHER_CTX;
    typedef ... EVP_CIPHER;
    typedef ... ENGINE;
    typedef uintptr_t EVP_PKEY;
    typedef uintptr_t X509;
    typedef uintptr_t DH;
    typedef uintptr_t RSA;
    typedef uintptr_t DSA;
    typedef uintptr_t EC_KEY;
    typedef ... EVP_MD_CTX;
    typedef ... EVP_PKEY_CTX;
    typedef ... BN_GENCB;
    typedef ... BIGNUM;

    void ERR_load_crypto_strings(void);
    void ERR_free_strings(void);

    unsigned long ERR_get_error(void);
    char *ERR_error_string(unsigned long e, char *buf);
    unsigned long ERR_peek_error(void);

    void OPENSSL_config(const char *config_name);

    EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void);
    void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx);

    int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
    int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *x, int padding);
    int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);

    const EVP_CIPHER *EVP_aes_128_cbc(void);
    const EVP_CIPHER *EVP_aes_192_cbc(void);
    const EVP_CIPHER *EVP_aes_256_cbc(void);
    const EVP_CIPHER *EVP_des_cbc(void);
    const EVP_CIPHER *EVP_des_ede_cbc(void);
    const EVP_CIPHER *EVP_des_ede3_cbc(void);
    const EVP_CIPHER *EVP_rc4(void);
    const EVP_CIPHER *EVP_rc2_cbc(void);

    int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
                    ENGINE *impl, const char *key,
                    const char *iv);
    int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, char *out, int *outl,
                    const char *in, int inl);
    int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, char *out, int *outl);

    int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
                    ENGINE *impl, const char *key,
                    const char *iv);
    int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, char *out, int *outl,
                    const char *in, int inl);
    int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, char *out, int *outl);

    EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const char **pp,
                    long length);
    EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const char **pp, long length);
    void EVP_PKEY_free(EVP_PKEY *key);

    X509 *d2i_X509(X509 **px, const char **in, int len);
    int i2d_X509(X509 *x, char **out);
    EVP_PKEY *X509_get_pubkey(X509 *x);
    void X509_free(X509 *a);

    EVP_MD_CTX *EVP_MD_CTX_create(void);
    void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx);

    int EVP_PKEY_size(EVP_PKEY *pkey);
    RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);
    void RSA_free(RSA *r);

    int RSA_public_encrypt(int flen, const char *from,
                    char *to, RSA *rsa, int padding);
    int RSA_private_encrypt(int flen, const char *from,
                    char *to, RSA *rsa, int padding);
    int RSA_public_decrypt(int flen, const char *from,
                    char *to, RSA *rsa, int padding);
    int RSA_private_decrypt(int flen, const char *from,
                    char *to, RSA *rsa, int padding);

    int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt);

    const EVP_MD *EVP_md5(void);
    const EVP_MD *EVP_sha1(void);
    const EVP_MD *EVP_sha224(void);
    const EVP_MD *EVP_sha256(void);
    const EVP_MD *EVP_sha384(void);
    const EVP_MD *EVP_sha512(void);

    int PKCS12_key_gen_uni(char *pass, int passlen, char *salt,
                    int saltlen, int id, int iter, int n,
                    char *out, const EVP_MD *md_type);

    void BN_free(BIGNUM *a);
    int BN_dec2bn(BIGNUM **a, const char *str);

    DH *DH_new(void);
    int DH_generate_parameters_ex(DH *dh, int prime_len, int generator, BN_GENCB *cb);
    int i2d_DHparams(const DH *a, char **pp);
    void DH_free(DH *dh);

    RSA *RSA_new(void);
    int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb);
    int i2d_RSAPublicKey(RSA *a, char **pp);
    int i2d_RSAPrivateKey(RSA *a, char **pp);

    DSA *DSA_new(void);
    int DSA_generate_parameters_ex(DSA *dsa, int bits,
                    const char *seed, int seed_len, int *counter_ret,
                    unsigned long *h_ret, BN_GENCB *cb);
    int DSA_generate_key(DSA *a);
    int i2d_DSA_PUBKEY(const DSA *a, char **pp);
    int i2d_DSAPrivateKey(const DSA *a, char **pp);
    void DSA_free(DSA *dsa);

    EC_KEY *EC_KEY_new_by_curve_name(int nid);
    int EC_KEY_generate_key(EC_KEY *key);
    void EC_KEY_set_asn1_flag(EC_KEY *, int);
    int i2d_ECPrivateKey(EC_KEY *key, char **out);
    int i2o_ECPublicKey(EC_KEY *key, char **out);
    void EC_KEY_free(EC_KEY *key);
 N/A N/A version_info N/A 1 N/A N/A N/A N/A ffi cdef 
        typedef ... *DSA_SIG;
        typedef ... *ECDSA_SIG;

        DSA_SIG *DSA_do_sign(const char *dgst, int dlen, DSA *dsa);
        ECDSA_SIG *ECDSA_do_sign(const char *dgst, int dgst_len, EC_KEY *eckey);

        DSA_SIG *d2i_DSA_SIG(DSA_SIG **v, const char **pp, long length);
        ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **v, const char **pp, long len);

        int i2d_DSA_SIG(const DSA_SIG *a, char **pp);
        int i2d_ECDSA_SIG(const ECDSA_SIG *a, char **pp);

        int DSA_do_verify(const char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa);
        int ECDSA_do_verify(const char *dgst, int dgst_len, const ECDSA_SIG *sig, EC_KEY *eckey);

        void DSA_SIG_free(DSA_SIG *a);
        void ECDSA_SIG_free(ECDSA_SIG *a);

        DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey);
        EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey);

        int RSA_verify_PKCS1_PSS(RSA *rsa, const char *mHash,
                        const EVP_MD *Hash, const char *EM,
                        int sLen);
        int RSA_padding_add_PKCS1_PSS(RSA *rsa, char *EM,
                        const char *mHash, const EVP_MD *Hash,
                        int sLen);

        int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);
        int EVP_SignFinal(EVP_MD_CTX *ctx, char *sig, unsigned int *s, EVP_PKEY *pkey);
        int EVP_VerifyFinal(EVP_MD_CTX *ctx, char *sigbuf, unsigned int siglen, EVP_PKEY *pkey);

        void EVP_MD_CTX_set_flags(EVP_MD_CTX *ctx, int flags);
     N/A N/A N/A N/A ffi cdef 
        int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
                        const char *salt, int saltlen, int iter,
                        const EVP_MD *digest,
                        int keylen, char *out);

        int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
        int EVP_DigestSignFinal(EVP_MD_CTX *ctx, char *sig, size_t *siglen);

        int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey);
        int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const char *sig, size_t siglen);

        int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, int cmd, int p1, void *p2);
    