nalinishrma1@gmail.com

Members
  • Content count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About nalinishrma1@gmail.com

  • Rank
    Newbie
  1. Hi, I have written javascript code as below to make in HmacSHA256 but i need in RSASHA256 to generate signature, can you plz help. public key= -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB -----END PUBLIC KEY----- Private Key= -----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQABAoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5CpuGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0KSu5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aPFaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw== -----END RSA PRIVATE KEY----- JS code: <script src="http://crypto- js.googlecode.com/svn/tags/3.0.2/build/rollups/hmac-sha256.js"></script>; <script src="http://crypto- js.googlecode.com/svn/tags/3.0.2/build/components/enc-base64-min.js"></script>; function aaa(message,secret) { var hash = CryptoJS.HmacSHA256("message", "secret"); var hashInBase64 = CryptoJS.enc.Base64.stringify(hash); return hashInBase64 }
  2. my Javascript code is working for HmacSHA256 but i need for RSASHA256 to generate token
  3. Hi, I have written javascript code as below to make in HmacSHA256 but i need in RSASHA256 to generate signature, can you plz help. public key= -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB -----END PUBLIC KEY----- Private Key= -----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQABAoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5CpuGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0KSu5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aPFaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw== -----END RSA PRIVATE KEY----- JS code: <script src="http://crypto- js.googlecode.com/svn/tags/3.0.2/build/rollups/hmac-sha256.js"></script>; <script src="http://crypto- js.googlecode.com/svn/tags/3.0.2/build/components/enc-base64-min.js"></script>; function aaa(message,secret) { var hash = CryptoJS.HmacSHA256("message", "secret"); var hashInBase64 = CryptoJS.enc.Base64.stringify(hash); return hashInBase64 }
  4. Not, Working...I have customize my example: I have 2 variable 'aassn' and 'addd' in xml format. my concern is if 'Idc' of 'aassn' is blank then dont need 'Idc' value in output and same if 'Idd' of 'addd' is blank then dont need in output. If, 'Idc' and 'Idd' contaning data then need both in output. where aassn= <?xml version="1.0" encoding="UTF-8"?> <info> <name> <Idc>81</Idc> </name> </info> and addd= <?xml version="1.0" encoding="UTF-8"?> <info> <name> <Idd></Idd> </name> </info> my code is var ssn1 = aassn.match(/<Idc\/>/); var acc1 = addd.match(/<Idd\/>/); var tempaassn = String(aassn); var tempacc = String(addd); var star1 = "Hi,\n\nDetails"; if (typeof(ssn1) != 'undefined' && ssn1 != '' && String(ssn1) != '' && tempaassn.indexOf('</Idc>') > -1) star1+= "\n\nBelow first data:\n\n" + aassn.split("<Idc>")[1].split( "</Idc>" )[0]; if (typeof(acc1) != 'undefined' && acc1 != '' && String(acc1) != '' && tempacc.indexOf('</Idd>') > -1) star1+= "\n\nBelow secound data\n\n" + addd.split("<Idd>")[1].split( "</Idd>" )[0]; return star1; But i am gettitng output as below while Idd of addd is blank: Hi, Details: Below first data: 81 Below secound data: But, i need Hi, Details: Below first data: 81
  5. Hi, I need whole XML in return if 'Id' from variable 'ad' is not blank. same I need whole XML in return if 'Id' from variable 'addd' is not blank. For that i have written function but getting function ttt(ad,addd) { var match = ad.match(/<Id\/>/); var matcht = addd.match(/<Id\/>/); if ((! match || match.length == 0) && (! matcht || matcht.length == 0)){ return "Below is the details of the Id of ad:\n\n" + ad.split("<Id>")[1].split("</Id>")[0]; + "\n\n And, Below is the details of the Id of addd:\n\n" +addd.split("<Id>")[1].split("</Id>")[0]; } }
  6. Hi, I have 2 XML stored in the variable 'ad' and 'addd' respectively: Variable 'ad': <?xml version="1.0" encoding="UTF-8"?> <name> <data> <Id>003</Id> </data> <data> <Id>006</Id> </data> .... </name> And Variable 'addd': <?xml version="1.0" encoding="UTF-8"?> <name> <data> <Id>009</Id> </data> <data> <Id>005</Id> </data> ... </name> I have written a `ttt` Javascript function: function ttt(ad,addd) { var match = ad.match(/<Id\/>/); var matcht = addd.match(/<Id\/>/); if ((! match || match.length == 0) && (! matcht || match.length == 0)){ return "Below is the details of the Id of ad:\n\n" + ad.split("<Id>")[1].split("</Id>")[0]; + "\n\n And, Below is the details of the Id of addd:\n\n" +addd.split("<Id>")[1].split("</Id>")[0]; } } I need `If` `Id` is not blank from 'ad' variable then return alert as `error` with `Id` as below, otherwise not: <?xml version="1.0" encoding="UTF-8"?> <name> <data> <Id>003</Id> </data> <data> <Id>006</Id> </data> </name> And, I need `If` `Id` is not blank from 'addd' variable then return alert as `error` with `Id` as below, otherwise not: <?xml version="1.0" encoding="UTF-8"?> <name> <data> <Id>009</Id> </data> <data> <Id>005</Id> </data> </name>