Adding password not null check

* passphrase not null/empty check
* throw ```java.security.cert.CertificateException``` instead of generic ```Exception```
* adding tests