try {
//create resource
System.out.println("Create PES resource");
X509Certificate cert = getKeystoreCertificate(CLIENT_KEYSTORE, CLIENT_PASSWORD, ALIAS);
MatchPattern mp = new MatchPattern(cert.getSubjectDN().toString(), cert);
estResourceEPR = pesProxy.createPesResource("myResource", mp);
} catch (RemoteException ex) {
throw new RuntimeException("Error encountered while creating a resource/Job" + ex.getMessage(), ex);
}