Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)

        def load_key(key_str):
    if "-----BEGIN RSA PRIVATE KEY-----" in key_str:
        return rsa.PrivateKey.load_pkcs1(key_str)
    else:
        return rsa.PublicKey.load_pkcs1(key_str)
        


src/c/r/cryptedserver-1.0.0/cryptedserver/server.py   cryptedserver(Download)
 
        if req["data"].has_key("action") and req["data"]["action"] == "init":
            sessions[req["session"]] = crypto.load_key(req["data"]["key"])
            res = {
                "key": crypto.export_key(pub),

src/c/r/cryptedserver-1.0.0/cryptedserver/client.py   cryptedserver(Download)
            "key": crypto.export_key(self.pub),
        })
        self.ser_pub = crypto.load_key(res["key"])