def _set_public_key_string(self, public_key_string):
# remove PKCS#8 header if it exists
if public_key_string.startswith(PKCS8_HEADER):
public_key_string = public_key_string[len(PKCS8_HEADER):]
# add the appropriate PEM header/footer
public_key_string = self._add_pem_headers(public_key_string, "RSA PUBLIC KEY")
self._public_key = PYRSA.PublicKey.load_pkcs1(public_key_string)
评论列表
文章目录