diff --git a/examples/.pony-lint.json b/examples/.pony-lint.json deleted file mode 100644 index 9ce37cf..0000000 --- a/examples/.pony-lint.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "rules": { - "style/package-docstring": "off" - } -} diff --git a/examples/README.md b/examples/README.md index 568ea4c..149651c 100644 --- a/examples/README.md +++ b/examples/README.md @@ -5,7 +5,7 @@ different part of the ssl library. Ordered from simplest to most involved: the hashing examples come first, the SSL networking example follows. -## [hash-fn-example](hash-fn-example/) +## [hash-fn](hash-fn/) Computes MD5, SHA1, and SHA256 hashes of a string in a single call each and prints the results. Shows the one-shot convenience functions `MD5`, @@ -13,7 +13,7 @@ and prints the results. Shows the one-shot convenience functions `MD5`, formatting the resulting `Array[U8] val`. Start here if you're new to the library. -## [digest-example](digest-example/) +## [digest](digest/) Hashes data in chunks using the streaming `Digest` API. Creates a `Digest.sha256()`, appends two string pieces with `append()`, and @@ -21,7 +21,7 @@ finalizes with `final()` to produce the hash. Also demonstrates `Digest.shake256(n)` for variable-length output on OpenSSL 3.0.x and 4.0.x, guarded by an `ifdef`. -## [ssl-client-server-example](ssl-client-server-example/) +## [ssl-client-server](ssl-client-server/) Runs a TLS client and server in the same process, exchanging a few messages over a loopback TCP connection. Demonstrates setting up an diff --git a/examples/digest/digest.pony b/examples/digest/digest.pony new file mode 100644 index 0000000..df2c7b1 --- /dev/null +++ b/examples/digest/digest.pony @@ -0,0 +1,7 @@ +""" +Hashes data in chunks using the streaming `Digest` API from `ssl/crypto`. + +Creates a SHA256 digest, appends data in two pieces, and finalizes to +produce the hash. On OpenSSL 3.0.x and 4.0.x, also demonstrates +`Digest.shake256` for variable-length output. +""" diff --git a/examples/digest-example/main.pony b/examples/digest/main.pony similarity index 100% rename from examples/digest-example/main.pony rename to examples/digest/main.pony diff --git a/examples/hash-fn/hash_fn.pony b/examples/hash-fn/hash_fn.pony new file mode 100644 index 0000000..4fc7826 --- /dev/null +++ b/examples/hash-fn/hash_fn.pony @@ -0,0 +1,4 @@ +""" +Computes MD5, SHA1, and SHA256 hashes using the one-shot convenience +functions from `ssl/crypto`. +""" diff --git a/examples/hash-fn-example/main.pony b/examples/hash-fn/main.pony similarity index 100% rename from examples/hash-fn-example/main.pony rename to examples/hash-fn/main.pony diff --git a/examples/ssl-client-server-example/main.pony b/examples/ssl-client-server/main.pony similarity index 100% rename from examples/ssl-client-server-example/main.pony rename to examples/ssl-client-server/main.pony diff --git a/examples/ssl-client-server/ssl_client_server.pony b/examples/ssl-client-server/ssl_client_server.pony new file mode 100644 index 0000000..21f5dee --- /dev/null +++ b/examples/ssl-client-server/ssl_client_server.pony @@ -0,0 +1,5 @@ +""" +Runs a TLS client and server in the same process, exchanging messages +over a loopback TCP connection. Demonstrates `SSLContext` setup and +`SSLConnection` wrapping from `ssl/net`. +"""