def searchForCertificate(self, id):
        if digest("{}cert".format(id)) in self.storage:
            data = self.storage.get(digest("{}cert".format(id)))
            try:
                return OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
                                                      data[1])
            except:
                return None
        name_dir = os.path.join(self.cert_conf["CA_default"]["runtimes_dir"], self.name)
        filename = os.listdir(os.path.join(name_dir, "others"))
        matching = [s for s in filename if id in s]
        if len(matching) == 1:
            file = open(os.path.join(name_dir, "others", matching[0]), 'rt')
            st_cert = file.read()
            try:
                cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM,
                                                    st_cert)
            except:
                logger(self.sourceNode,
                      "Loading error for certificate "
                      "with id: {}".format(id))
                return None
            file.close()
            return cert
        else:
            return None
Seaches the internal storage for the certificate
dataset/ETHPy150Open EricssonResearch/calvin-base/calvin/runtime/south/plugins/storage/twistedimpl/securedht/append_server.py/KademliaProtocolAppend.searchForCertificate