Add unit tests for netkeystore.

+ some boundary checks.
3 files changed