No description
Find a file
Ganesh Viswanathan 893ae26213 Fix for local
2019-12-25 17:22:14 -06:00
nimssl Fix for local 2019-12-25 17:22:14 -06:00
tests Lower nim requirement 2019-12-17 22:04:18 -06:00
.gitignore Use nimterop instead of nimgen 2019-12-17 21:30:31 -06:00
.travis.yml Remove OSX, STACK 2019-12-17 22:11:31 -06:00
generate.nim Updated generator script and order of cImports (#3) 2019-12-25 17:20:35 -06:00
LICENSE Initial commit 2017-11-07 19:10:33 -06:00
nimssl.nim Use nimterop instead of nimgen 2019-12-17 21:30:31 -06:00
nimssl.nimble Lower nim requirement 2019-12-17 22:04:18 -06:00
README.md Add CI, minor cleanup 2019-12-17 21:58:50 -06:00

Nimssl is a Nim wrapper for the OpenSSL library.

Nimssl is distributed as a Nimble package and depends on Nimterop to generate the wrappers. The OpenSSL source code is downloaded using Git so having git in the path is required.

Installation

Nimssl can be installed via Nimble:

> nimble install nimssl

This will download, wrap and install nimssl in the standard Nimble package location, typically ~/.nimble. Once installed, its libraries can be imported into any Nim program.

Usage

To get started, here is an example:

import nimssl/crypto

var test = "Hello, world!"
var hash = SHA256(addr test[0], cast[uint](test.len()), nil)

echo hash.toArray(32).toHex()

When compiling with nimssl/crypto, include the -d:cryptoStd command line flag, and -d:sslStd when compiling with nimssl/ssl. The first compile will be slow, but those after should be much faster. If you are experiencing consistently slow compile times, try including the -f:off flag.

Nimssl currently wraps almost everything from OpenSSL's libcrypto and libssl, but few things are tested (refer to tests). Contributions to the tests pool are appreciated!

Credits

Nimssl wraps the OpenSSL source code and all licensing terms of OpenSSL apply to the usage of this package.

Feedback

Nimssl is a work in progress and any feedback or suggestions are welcome. It is hosted on GitHub with an MIT license so issues, forks and PRs are most appreciated.