File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Client Certification Credential - EWS JAVA API 1.5 - Help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Client Certification Credential - EWS JAVA API 1.5 - Help needed" Watch "Client Certification Credential - EWS JAVA API 1.5 - Help needed" New topic
Author

Client Certification Credential - EWS JAVA API 1.5 - Help needed

Kumarjit Chakraborty
Greenhorn

Joined: Aug 08, 2009
Posts: 8
1 down vote favorite
share [g+] share [fb] share [tw]


I am very new to JAVA and Exchange Web Services. I need to use client certificate for authentication in exchange server using ClientCertificateCredentials class. But I am not able to understand how to implement it. I have tried with the following code:

public static TrustManager getTrustManager () {

try {
File f = new File("ctest.pfx");
FileInputStream is = new FileInputStream(f);
KeyStore ks = KeyStore.getInstance("PKCS12");
String p = "password";
ks.load(is, p.toCharArray());
TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX");
tmf.init(ks);
TrustManager tms[] = tmf.getTrustManagers();
return tms[0];
} catch (Exception ex) {
ex.printStackTrace();
return null;
}

}

And then initializing it like:

ClientCertificateCredentials credentials = new ClientCertificateCredentials(TMImpl.getTrustManager());

But everytime it throws an error:

NTLM authentication scheme selected
No credentials available for NTLM @MyIP:MyPort

Can you please help me understanding what I am doing wrong here.

Thanks in Advance,
Kumarjit
Ora Quw
Greenhorn

Joined: Jun 23, 2012
Posts: 1
JWebServices for Exchange
Kumarjit Chakraborty
Greenhorn

Joined: Aug 08, 2009
Posts: 8
Hi Ora Quw,

Thanks for the reply.

I have gone through those apis earlier, however they do not mention about using client certificates. Please let me know if I am missing something here.

Thanks,
Kumarjit
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Client Certification Credential - EWS JAVA API 1.5 - Help needed
 
Similar Threads
SSL code returns HTTPClient.HttpURLConnection
EWS : Transport error: 401 Error: Unauthorized
How do I get a hold of Java's default SSL Trust Manager?
Setting WEb services credentials
Getting services to work with NTLM Authentication over HTTPS/SSL