extracting public key from certificate and encrypting data

后端 未结 2 1092
眼角桃花
眼角桃花 2020-12-17 06:32

This is for a homework assignment! I get the server\'s certificate using get_peer_certificate() and the calling dump_certificate to dump the certif

2条回答
  •  轮回少年
    2020-12-17 06:38

        crtObj = crypto.load_certificate(crypto.FILETYPE_ASN1, config.x509_certificate)
        pubKeyObject = crtObj.get_pubkey()
        pubKeyString = crypto.dump_publickey(crypto.FILETYPE_PEM, pubKeyObject)
    

提交回复
热议问题