This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!

kamal palia

Greenhorn
+ Follow
since Jul 20, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by kamal palia

I've installed the BouncyCastle cryptography provider on my system, placing bcprov-jdk16-145.jar in my application lib folder and added the line
security.provider.8=org.bouncycastle.jce.provider.BouncyCastleProvider
to java.security. I have verified that it's correctly installed by running a Standard Edition application which uses it.

However, when I try to run my Enterprise app in weblogic server, which uses BouncyCastle, I get the following error:
java.security.NoSuchProviderException: no such provider: BC
when my code attempts to execute the following line:
factory = KeyFactory.getInstance(algorithm, "BC");

Please suggest any soultion?
5 years ago
I have two different application servers and generated key pair in one server and shared public key with client.
Now whenever client will send some encrypted data loadbalancer will try to send request to any one of the server, which means in both server private key should be available so for this purpose, i need to copy key pair from one app server jks file to another app server jks file.
So what's wrong in this?
5 years ago
I got the command for copying key pair from one keystore to another keystore given below

C:\>keytool -import -keystore D:\key\keystore.jks -keystore D:\key\Server\keysstore.jks -storepass password -storepass password -alias merchantkey -alias merchantkey -keypass password -keypass password


but it is giving error
keytool error: java.lang.Exception: Input not an X.509 certificate

any idea?
5 years ago
I have generated key pair into cacerts using keytool -genkey command and its generated successfuly.
Now i have to import same key pair with same alias name into another cacerts so how can i do this?
5 years ago
Thanks to all for their help.....
web.xml entry for session time out is working fine.
5 years ago
My weblogic.xml contains
<weblogic-web-app>
<resource-description>
<res-ref-name>jdbc/pgDataSource</res-ref-name>
<jndi-name>weblogic.jdbc.jts.pgDataSource</jndi-name>
</resource-description >
<session-descriptor>
<session-param>
<param-name>TimeoutSecs</param-name>
<param-value>300</param-value>
</session-param>
</session-descriptor>
<context-root>/</context-root>
</weblogic-web-app>

i have given 300 sec of timeout but don't know why session do not get timeout even i tried this in web.xml(5 min)
<session-config>
<session-timeout>5</session-timeout>
</session-config>

any idea?
5 years ago
What value(default) session.getMaxInactiveInterval() will return.
and
If i am using
<session-config>
<session-timeout>2</session-timeout>
</session-config>
in my web.xml and session.getMaxInactiveInterval() in jsp then which timeout my app will use.
5 years ago
I am able to access all the nodes value by using

NodeList requestID = element.getElementsByTagName("request-id");
Element line = (Element) requestID.item(0);

but using same how can i get the value of

<auth-data>
<field name='OTP2' value='360055' />
</auth-data>

360055?
<form action="http://localhost:7003/MultiMPI/Authenticate" method="post">
<textarea name="xmlData" cols=90 rows=90>
<req-auth>
<request-id>4sS4yV6tQ2</request-id>
<response-id>MTQ0NzY2</response-id>
<req-type>1002</req-type>
<auth-data>
<field name='OTP2' value='360055' />
</auth-data>
</req-auth>
</textarea>
<br><input type="submit" value="Request">
</form>



how can i get value 360055?
Hey Ashwini, Thanks for your help....:)
Its working now we can use as follows::

PrintWriter out = response.getWriter();
out.println("<form name=\"motoForm\" action=\"/abc.jsp\" method=\"POST\" >");
out.println("<input type=hidden name=\"shoppingContext\" value=\"" + this.requestID + "\">");
out.println("<script language=javascript>window.onload = function() { document.forms[0].submit(); }</script>");
out.println("</form>");

and it directly calls that jsp.
5 years ago
JSP
Hi,
I am writing html code in servlet as given below:::

StringBuffer oStringBuffer = new StringBuffer();
oStringBuffer.append("<form name=\"motoForm\" action=\"/vbv/MPIEntry.jsp\" method=\"POST\" >");
oStringBuffer.append("<input type=hidden name=\"shoppingContext\" value=\"" + this.requestID + "\">");
oStringBuffer.append("<input type=hidden name=\"pan\" value=\"" + this.cardNumber + "\">");
oStringBuffer.append("<input type=hidden name=\"expirydate\" value=\"" + this.expiry + "\">");
oStringBuffer.append("<script language=javascript>window.onload = function() { document.forms[0].submit(); }</script>");
oStringBuffer.append("</form>");

but when i run servlet it do not call jsp page.
5 years ago
JSP
Below are the files::
a) epgSupport.bat file which i run through cmd contains

jar -cvf epgSupport.jar D:\epgFDC\src\com\opus\epg\acqregistration\AcquirerLister.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\acqregistration\AcquirerRegister.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\acqregistration\CodeDescProvider.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\acqregistration\SysRespCodeProvider.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\AuthenticatorBaseInterface.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\BaseAuthenticator.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\RelatedTxnAuthenticator.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\RootTxnAuthenticator.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\cardchecker\CardChecker.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\MPIResponseValidator.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\MPIResponseValidatorConfiguration.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\auditaccessor\AuditTblListPresentationObject.class
jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\auditaccessor\AuditTblListDataObject.class

b) If i check the path D:\epgFDC\src\com\opus\epg\acqregistration then it contains that file(AcquirerLister.class)
but in command prompt it shows

D:\epgFDC\src>jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\RelatedTxnAuthenticator.class
java.io.FileNotFoundException: epgSupport.jar (The system cannot find the file specified.)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:123)
at sun.tools.jar.Main.run(Main.java:204)
at sun.tools.jar.Main.main(Main.java:1161)

D:\epgFDC\src>jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\cardchecker\CardChecker.class
java.io.FileNotFoundException: epgSupport.jar (The system cannot find the file specified.)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:123)
at sun.tools.jar.Main.run(Main.java:204)
at sun.tools.jar.Main.main(Main.java:1161)

D:\epgFDC\src>jar -uf epgSupport.jar D:\epgFDC\src\com\opus\epg\authenticator\MPIResponseValidator.class
java.io.FileNotFoundException: epgSupport.jar (The system cannot find the file specified.)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:123)
at sun.tools.jar.Main.run(Main.java:204)
at sun.tools.jar.Main.main(Main.java:1161)
5 years ago
I have .bat file which i run through command prompt to create jar file.
EX:: epgSupport.bat file contains the path of class files, but when i run batch file it shows following error and generate temp files(jartmp952913122216805571.tmp):::

java.io.FileNotFoundException: epgSupport.jar (The system cannot find the file s
pecified.)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:123)
at sun.tools.jar.Main.run(Main.java:204)
at sun.tools.jar.Main.main(Main.java:1161)

and i have checked that the file is present in the given location but still it shows same error.
Please give your suggestions to handle this problem.
5 years ago
Thanks jasper with the help of you my problem is solved.
5 years ago


To Seal(From client)-->

try {
FullKeyPair receiverKeyPair = null;
receiverKeyPair = PKCS7EncryptedEnvelope.generate("CN=Icici", "CN=someOtherIssuer",
BigInteger.ONE, "RSA", 1024, 1);
} catch (Exception x) {
x.printStackTrace();
}
final byte[] clearTextBytes = panNumber.getBytes("UTF-8");
byte[] sealed = null;
try {
envelope.addRecipient(receiverKeyPair.getX509Certificate());
sealed = envelope.seal(clearTextBytes);
panNumber = new String(sealed, "UTF-8");
System.out.println("sealed: "+panNumber);
} catch (Exception x) {
x.printStackTrace();
response.sendRedirect("Error.jsp");
}



To Unseal (in server)-->
try {
FullKeyPair receiverKeyPair = null;
receiverKeyPair = PKCS7EncryptedEnvelope.generate("CN=Icici", "CN=someOtherIssuer",
BigInteger.ONE, "RSA", 1024, 1);
} catch (Exception x) {
x.printStackTrace();
throw new VBVException(VBVConstants.ERR_CODE_GENERIC, "Internal Processing Error");
}
try{
String panNumber = request.getParameter("panNumber");
PKCS7EncryptedEnvelope envelope = new PKCS7EncryptedEnvelope();
final byte[] clearTextBytes = panNumber.getBytes();
System.out.println("clearTextBytes::"+clearTextBytes);
envelope.setPrivateKey(receiverKeyPair.getPrivateKey());
byte[] unsealed = envelope.unseal(clearTextBytes);
panNumber = new String(unsealed, "UTF-8");
System.out.println("panNumber2 ::"+panNumber);
}catch (Exception x) {
x.printStackTrace();
throw new VBVException(VBVConstants.ERR_CODE_GENERIC, "Internal Processing Error");
}

5 years ago