kumar
10-20-03, 05:38 AM
Hi guys,
I am getting problems with the SSLight as it is my first project on the SSL stuff. I doing a project to interact with the UPS online tools. They provided me some packages for SSLight and also they provided me a key. And I dont have any digital certificate. And VAJ 3.5 IDE. And when I try executing the following code, its throwing an exception
--------------------------------------------------------------------------------------------
com.ibm.samplepackage.SSLContext context = new com.ibm.samplepackage.SSLContext();
SSLPKCS12Token token = new SSLPKCS12Token();
FileInputStream kin = null;
//com.ibm.samplepackage.https.HttpsAuthenticator ha = new Proxy(username, password);
try
{
byte[] data = new byte[ (int) new File(keyLocation).length()];
(kin = new FileInputStream(keyLocation)).read(data);
token.open(data, password);
} catch (Exception e)
{
try
{
kin.close();
}
catch (Exception ex)
{
} System.out.println("https: Cannot load key ring: " + e);
throw e;
}
context.importToken(token);
------------------------------------------------------------------------------------------------
The exception I'm getting is :
https: Cannot load key ring: com.ibm.samplepackage.SSLRuntimeException: reason=23 (Unuspported format or feature)
-------------------------------------------------------------------------------------------------
I'm not pretty sure , is it the way to read a token into the SSL context.
I dont know the problem with my code. Can any one help me on this
Thanks
I am getting problems with the SSLight as it is my first project on the SSL stuff. I doing a project to interact with the UPS online tools. They provided me some packages for SSLight and also they provided me a key. And I dont have any digital certificate. And VAJ 3.5 IDE. And when I try executing the following code, its throwing an exception
--------------------------------------------------------------------------------------------
com.ibm.samplepackage.SSLContext context = new com.ibm.samplepackage.SSLContext();
SSLPKCS12Token token = new SSLPKCS12Token();
FileInputStream kin = null;
//com.ibm.samplepackage.https.HttpsAuthenticator ha = new Proxy(username, password);
try
{
byte[] data = new byte[ (int) new File(keyLocation).length()];
(kin = new FileInputStream(keyLocation)).read(data);
token.open(data, password);
} catch (Exception e)
{
try
{
kin.close();
}
catch (Exception ex)
{
} System.out.println("https: Cannot load key ring: " + e);
throw e;
}
context.importToken(token);
------------------------------------------------------------------------------------------------
The exception I'm getting is :
https: Cannot load key ring: com.ibm.samplepackage.SSLRuntimeException: reason=23 (Unuspported format or feature)
-------------------------------------------------------------------------------------------------
I'm not pretty sure , is it the way to read a token into the SSL context.
I dont know the problem with my code. Can any one help me on this
Thanks