Skip to content
WinKerberos wrapper for Nim
Nim
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.gitignore
LICENSE
README.md
nimkerberos.cfg
nimkerberos.nimble

README.md

Nimkerberos is a Nim wrapper for the WinKerberos library.

Nimkerberos is distributed as a Nimble package and depends on nimgen and c2nim to generate the wrappers. The WinKerberos source code is downloaded using Git so having git in the path is required.

Installation

Nimkerberos can be installed via Nimble:

> nimble install nimkerberos

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

Usage

Module documentation can be found here.

import nimkerberos/kerberos_sspi

var ctxt: sspi_client_state
var ret = auth_sspi_client_init(
    newWideCString("NTLM"), 0, nil, 0, nil, 0, nil, 0, newWideCString("Negotiate"), addr ctxt)
assert ret == AUTH_GSS_COMPLETE

ret = auth_sspi_client_step(addr ctxt, "".cstring, nil)
assert ret == 0

echo ctxt.response

destroy_sspi_client_state(addr ctxt)

The kerberos_sspi.h functions are directly accessible at this time. A higher level API as provided by WinKerberos for Python is still TBD.

Refer to the tests directory for examples on how the library can be used.

Credits

Nimkerberos wraps the WinKerberos source code and all licensing terms of WinKerberos apply to the usage of this package.

Credits go out to c2nim as well without which this package would be greatly limited in its abilities.

Feedback

Nimkerberos 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.

You can’t perform that action at this time.