Added public keys support
Added some unit tests