sign.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:solaris-ips 作者: oracle 项目源码 文件源码
def __make_tmp_cert(d, pth):
        try:
                with open(pth, "rb") as f:
                        cert = x509.load_pem_x509_certificate(f.read(),
                            default_backend())
        except (ValueError, IOError) as e:
                raise api_errors.BadFileFormat(_("The file {0} was expected to "
                    "be a PEM certificate but it could not be read.").format(
                    pth))
        fd, fp = tempfile.mkstemp(dir=d)
        with os.fdopen(fd, "wb") as fh:
                fh.write(cert.public_bytes(serialization.Encoding.PEM))
        return fp
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号