added test and documentation example for custom keystore