rsa_certificate_authority.py 文件源码

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

项目:bless 作者: Netflix 项目源码 文件源码
def __init__(self, pem_private_key, private_key_password=None):
        """
        RSA Certificate Authority used to sign certificates.
        :param pem_private_key: PEM formatted RSA Private Key.  It should be encrypted with a
        password, but that is not required.
        :param private_key_password: Password to decrypt the PEM RSA Private Key, if it is
        encrypted.  Which it should be.
        """
        super(SSHCertificateAuthority, self).__init__()
        self.public_key_type = SSHPublicKeyType.RSA

        self.private_key = load_pem_private_key(pem_private_key,
                                                private_key_password,
                                                default_backend())

        self.signer = self.private_key.signer(padding.PKCS1v15(),
                                              hashes.SHA1())
        ca_pub_numbers = self.private_key.public_key().public_numbers()

        self.e = ca_pub_numbers.e
        self.n = ca_pub_numbers.n
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号