Skip to content

Commit c37b57f

Browse files
committed
Update docs with current pkey.new() parameters and pkey:derive() method
1 parent 9130029 commit c37b57f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

doc/luaossl.pdf

9.03 KB
Binary file not shown.

doc/luaossl.tex

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,13 @@ \section{Modules}
276276

277277
\module{openssl.pkey} binds OpenSSL's libcrypto public-private key library. The \fn{\_\_tostring} metamethod generates a PEM encoded representation of the public key---excluding the private key.
278278

279-
\subsubsection[\fn{pkey.new}]{\fn{pkey.new($string$[, $format$])}}
279+
\subsubsection[\fn{pkey.new}]{\fn{pkey.new($string$[, $format$[, $type$[, $curve$]]]])}}
280280

281-
Initializes a new pkey object from the PEM- or DER-encoded key in $string$. $format$ defaults to ``*'', which means to automatically test the input encoding. If $format$ is explicitly ``PEM'' or ``DER'', then only that decoding format is used.
281+
Initializes a new pkey object from the PEM- or DER-encoded key in $string$. $format$ defaults to ``*'', which means to automatically detect the input encoding. If $format$ is explicitly ``PEM'' or ``DER'', then only that decoding format is used.
282+
283+
If specified, $type$ may be ``public'' or ``private'' to indicate loading a public or private key, respectively.
284+
285+
In the case of loading an EC key in a format that does not include the curve parameters, the $curve$ parameter should indicate the appropriate curve name.
282286

283287
On failure throws an error.
284288

@@ -335,6 +339,11 @@ \section{Modules}
335339

336340
Returns the PEM encoded string representation(s) of the specified key component. $which$ must be one of ``public'', ``PublicKey'', ``private'', or ``PrivateKey''. For the two argument form, returns two values.
337341

342+
\subsubsection[\fn{pkey:derive}]{\fn{pkey:derive($peer$)}}
343+
344+
Calculate the shared secret (e.g. DH/ECDH) derived from the key and the peer's
345+
(usually public) key.
346+
338347
\end{Module}
339348

340349

0 commit comments

Comments
 (0)