I followed the following steps for integrating the non-shameless CCAvenue
GateWay
Steps:-
I have my merchant id and access code's(url,ip).
- I am calling my server for getting the RSA key parameters (access_code ,order_id)
// my server already register in CCAvenue Server 2.my server calling the Avenue for RSA key
3.my server forwarding the RSA key
4.once i got i am removing extra lines"\n ",double quotes" "--" ",and "\"
// removing double quates
NSString * newReplacedString2 = [rsaKey stringByReplacingOccurrencesOfString:@"\"" withString:@""];
//removing /n in the key
NSString * newReplacedString = [newReplacedString2 stringByReplacingOccurrencesOfString:@"\\n" withString:@""];
//removing / in the key
NSString * newReplacedString1 = [newReplacedString stringByReplacingOccurrencesOfString:@"\\" withString:@""];
5.and i am placing that key between
rsaKey = [NSString stringWithFormat:@"-----BEGIN PUBLIC KEY-----\n%@\n-----END PUBLIC KEY-----\n",newReplacedString1];
//*******//***//****//**// output //*******//***//****//**//
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuV7OdmPSutrlOE9lF3YdW4ymGn+qselCOycMk95Tobw1PcqCeAWkrnxUECpAdnHGrUKmFbEDHs3wnwzLTbfa3GvE5dvvmluug78X3RYEFQiMh1QpfS5fBfvs4WQKw7oigko3G0UwZLZFnZ4E4WKTQi4wbCgjwQJFMnMGJfFYNcoSJluVg/q8z3bVxfDOV0ZPWccmvA3bTf9YFHKCC3clscQrGf1NPnBGcBGm+s06t3EljoSmpjtyTgSiGrqBZ8TSCQxoyXxS+RkhNTigg6mqW9hIisxYYqlbzvRnCDhuqgZfmP7t65QG5raELVE7d+Ia+dgh024luZ9+vSk4Qb65DQIDAQAB
-----END PUBLIC KEY-----
I am encrypting the amount and price using CCTool
NSString *myRequestString = [NSString stringWithFormat:@"amount=%@¤cy=%@",amount,currency];(2,INR) CCTool *ccTool = [[CCTool alloc] init]; NSString *encVal = [ccTool encryptRSA:myRequestString key:rsaKey];
in that I am getting the Exe_Bad_Acess in
RSA *rsa = PEM_read_bio_RSA_PUBKEY(bufio, NULL,NULL,NULL);
that rsa getting error.
how to resolve this issue.Please Help me Guys.!!