Skip to content

Commit c00a19a

Browse files
authored
Merge pull request #184 from munagekar/master
Fix Return Type For to_pem
2 parents e24c027 + ac431c5 commit c00a19a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/ecdsa/keys.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,10 @@ def to_pem(self, point_encoding="uncompressed"):
531531
implementations, it is as big as "uncompressed".
532532
533533
:return: portable encoding of the public key
534-
:rtype: str
534+
:rtype: bytes
535+
536+
.. warning:: The PEM is encoded to US-ASCII, it needs to be
537+
re-encoded if the system is incompatible (e.g. uses UTF-16)
535538
"""
536539
return der.topem(self.to_der(point_encoding), "PUBLIC KEY")
537540

@@ -937,7 +940,10 @@ def to_pem(self, point_encoding="uncompressed"):
937940
:param str point_encoding: format to use for encoding public point
938941
939942
:return: PEM encoded private key
940-
:rtype: str
943+
:rtype: bytes
944+
945+
.. warning:: The PEM is encoded to US-ASCII, it needs to be
946+
re-encoded if the system is incompatible (e.g. uses UTF-16)
941947
"""
942948
# TODO: "BEGIN ECPARAMETERS"
943949
return der.topem(self.to_der(point_encoding), "EC PRIVATE KEY")

0 commit comments

Comments
 (0)