@@ -848,7 +848,7 @@ def from_pem(cls, string, hashfunc=sha1):
848848 Initialise from key stored in :term:`PEM` format.
849849
850850 The PEM formats supported are the un-encrypted RFC5915
851- (the sslay format) supported by OpenSSL, and the more common
851+ (the ssleay format) supported by OpenSSL, and the more common
852852 un-encrypted RFC5958 (the PKCS #8 format).
853853
854854 The legacy format files have the header with the string
@@ -891,7 +891,7 @@ def from_der(cls, string, hashfunc=sha1):
891891 Initialise from key stored in :term:`DER` format.
892892
893893 The DER formats supported are the un-encrypted RFC5915
894- (the sslay format) supported by OpenSSL, and the more common
894+ (the ssleay format) supported by OpenSSL, and the more common
895895 un-encrypted RFC5958 (the PKCS #8 format).
896896
897897 Both formats contain an ASN.1 object following the syntax specified
@@ -909,12 +909,12 @@ def from_der(cls, string, hashfunc=sha1):
909909
910910 The only format supported for the `parameters` field is the named
911911 curve method. Explicit encoding of curve parameters is not supported.
912- In the legacy sslay format, this implementation requires the optional
912+ In the legacy ssleay format, this implementation requires the optional
913913 `parameters` field to get the curve name. In PKCS #8 format, the curve
914914 is part of the PrivateKeyAlgorithmIdentifier.
915915
916- The PKCS #8 format includes this object as the `privateKey` field
917- within a larger structure:
916+ The PKCS #8 format includes an ECPrivateKey object as the `privateKey`
917+ field within a larger structure:
918918
919919 OneAsymmetricKey ::= SEQUENCE {
920920 version Version,
@@ -953,7 +953,7 @@ def from_der(cls, string, hashfunc=sha1):
953953 version , s = der .remove_integer (s )
954954
955955 # At this point, PKCS #8 has a sequence containing the algorithm
956- # identifier and the curve identifier. The sslay format instead has
956+ # identifier and the curve identifier. The ssleay format instead has
957957 # an octet string containing the key data, so this is how we can
958958 # distinguish the two formats.
959959 if der .is_sequence (s ):
@@ -983,7 +983,7 @@ def from_der(cls, string, hashfunc=sha1):
983983 s , _ = der .remove_octet_string (s )
984984
985985 # Unpack the ECPrivateKey to get to the key data octet string,
986- # and rejoin the sslay parsing path.
986+ # and rejoin the ssleay parsing path.
987987 s , empty = der .remove_sequence (s )
988988 if empty != b ("" ):
989989 raise der .UnexpectedDER (
@@ -1049,7 +1049,7 @@ def to_string(self):
10491049 s = number_to_string (secexp , self .privkey .order )
10501050 return s
10511051
1052- def to_pem (self , point_encoding = "uncompressed" , format = "sslay " ):
1052+ def to_pem (self , point_encoding = "uncompressed" , format = "ssleay " ):
10531053 """
10541054 Convert the private key to the :term:`PEM` format.
10551055
@@ -1062,7 +1062,7 @@ def to_pem(self, point_encoding="uncompressed", format="sslay"):
10621062 ``BEGIN PRIVATE KEY``, depending on the desired format.
10631063
10641064 :param str point_encoding: format to use for encoding public point
1065- :param str format: either `sslay` or `pkcs8`
1065+ :param str format: either ``ssleay`` (default) or `` pkcs8` `
10661066
10671067 :return: PEM encoded private key
10681068 :rtype: bytes
@@ -1071,11 +1071,11 @@ def to_pem(self, point_encoding="uncompressed", format="sslay"):
10711071 re-encoded if the system is incompatible (e.g. uses UTF-16)
10721072 """
10731073 # TODO: "BEGIN ECPARAMETERS"
1074- assert format in ("sslay " , "pkcs8" )
1075- header = "EC PRIVATE KEY" if format == "sslay " else "PRIVATE KEY"
1074+ assert format in ("ssleay " , "pkcs8" )
1075+ header = "EC PRIVATE KEY" if format == "ssleay " else "PRIVATE KEY"
10761076 return der .topem (self .to_der (point_encoding , format ), header )
10771077
1078- def to_der (self , point_encoding = "uncompressed" , format = "sslay " ):
1078+ def to_der (self , point_encoding = "uncompressed" , format = "ssleay " ):
10791079 """
10801080 Convert the private key to the :term:`DER` format.
10811081
@@ -1085,7 +1085,7 @@ def to_der(self, point_encoding="uncompressed", format="sslay"):
10851085 The public key will be included in the generated string.
10861086
10871087 :param str point_encoding: format to use for encoding public point
1088- :param str format: either `sslay` or `pkcs8`
1088+ :param str format: either ``ssleay`` (default) or `` pkcs8` `
10891089
10901090 :return: DER encoded private key
10911091 :rtype: bytes
@@ -1094,7 +1094,7 @@ def to_der(self, point_encoding="uncompressed", format="sslay"):
10941094 # cont[1],bitstring])
10951095 if point_encoding == "raw" :
10961096 raise ValueError ("raw encoding not allowed in DER" )
1097- assert format in ("sslay " , "pkcs8" )
1097+ assert format in ("ssleay " , "pkcs8" )
10981098 encoded_vk = self .get_verifying_key ().to_string (point_encoding )
10991099 # the 0 in encode_bitstring specifies the number of unused bits
11001100 # in the `encoded_vk` string
@@ -1105,7 +1105,7 @@ def to_der(self, point_encoding="uncompressed", format="sslay"):
11051105 der .encode_constructed (1 , der .encode_bitstring (encoded_vk , 0 )),
11061106 )
11071107
1108- if format == "sslay " :
1108+ if format == "ssleay " :
11091109 return ec_private_key
11101110 else :
11111111 return der .encode_sequence (
0 commit comments