travis_pypi_setup.py 文件源码

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

项目:alexafsm 作者: allenai 项目源码 文件源码
def load_key(pubkey):
    """Load public RSA key, with work-around for keys using
    incorrect header/footer format.

    Read more about RSA encryption with cryptography:
    https://cryptography.io/latest/hazmat/primitives/asymmetric/rsa/
    """
    try:
        return load_pem_public_key(pubkey.encode(), default_backend())
    except ValueError:
        # workaround for https://github.com/travis-ci/travis-api/issues/196
        pubkey = pubkey.replace('BEGIN RSA', 'BEGIN').replace('END RSA', 'END')
        return load_pem_public_key(pubkey.encode(), default_backend())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号