Code example for KeyStoreException

0
 */ 
 
public class MyTrustManagerFactorySpi extends TrustManagerFactorySpi {
    protected void engineInit(KeyStore ks) throws KeyStoreException {
        if (ks == null) {
            throw new KeyStoreException("Not supported operation for null KeyStore");
        } 
    } 
 
    protected void engineInit(ManagerFactoryParameters spec)
            throws InvalidAlgorithmParameterException { 
        if (spec == null) {
            throw new InvalidAlgorithmParameterException("Null parameter");
        } 
        if (spec instanceof Parameters) {
            try { 
                engineInit(((Parameters)spec).getKeyStore());
            } catch (KeyStoreException e) {
                throw new RuntimeException(e);
            } 
        } else {