privateKey = (PrivateKey) keyStore.getKey(PRIVATEKEY_ALIAS, PRIVATEKEY_PASS.toCharArray());
privateKey = (PrivateKey) keyStore.getKey(PRIVATEKEY_ALIAS,PRIVATEKEY_PASS.toCharArray()); if (privateKey == null) throw new SignatureManagerException("Could not get PrivateKey");
    public SignatureManager()            throws SignatureManagerException {        if (keyStore == null || privateKey == null) {            try {                keyStore = KeyStore.getInstance(KEYSTORE_TYPE);                File keystoreFile = new File(keystoreFileName);                if (!keystoreFile.exists())                    throw new SignatureManagerException("Could not find keystore at " + keystoreFile.getCanonicalPath());                FileInputStream fis = new FileInputStream(keystoreFile);                keyStore.load(fis, KEYSTORE_PASS.toCharArray());                privateKey = (PrivateKey) keyStore.getKey(PRIVATEKEY_ALIAS,                                                    PRIVATEKEY_PASS.toCharArray());            } catch (Exception e) {                throw new SignatureManagerException(e);            }        }        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();        dbf.setNamespaceAware(true);        try {            db = dbf.newDocumentBuilder();        } catch (ParserConfigurationException e) {            throw new SignatureManagerException(e);        }    }