Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/ecdsa/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,10 @@ def to_pem(self, point_encoding="uncompressed"):
implementations, it is as big as "uncompressed".

:return: portable encoding of the public key
:rtype: str
:rtype: bytes

.. warning:: The PEM is encoded to US-ASCII, it needs to be
re-encoded if the system is incompatible (e.g. uses UTF-16)
"""
return der.topem(self.to_der(point_encoding), "PUBLIC KEY")

Expand Down Expand Up @@ -937,7 +940,10 @@ def to_pem(self, point_encoding="uncompressed"):
:param str point_encoding: format to use for encoding public point

:return: PEM encoded private key
:rtype: str
:rtype: bytes

.. warning:: The PEM is encoded to US-ASCII, it needs to be
re-encoded if the system is incompatible (e.g. uses UTF-16)
"""
# TODO: "BEGIN ECPARAMETERS"
return der.topem(self.to_der(point_encoding), "EC PRIVATE KEY")
Expand Down