3 Replies Latest reply on Aug 14, 2012 1:11 PM by zaheerbasra

    Can catalog tester credentails be changed to customize a Punchout request test?

    Bill Droege Novice

      How might I change my catalog testing credentials for my Punchout request test - including sender identity and shared secrect?

        • Re: Can catalog tester credentails be changed to customize a Punchout request test?
          zaheerbasra Apprentice

          Yes you can do this. Select Catalogs from the top left menu then select the catalog that you want to test and during the test change these settings. On next window you will see this drop down(default credentials) and next to this there is this button "Customize Set". By clicking this in next window you will see you can customize most of the request data. The shared secrete can only be changed where we configure the secrete but the credentialsand any other information you can change here.

            • Re: Can catalog tester credentails be changed to customize a Punchout request test?
              Bill Droege Novice

              Thanks,

              I have used that to customize the To Doman –

              What I am struggling with is how to un-encrypt the shared secret that is sent in the cXML Punchout Request.  I don’t have any method to decrypt it on my end.

              If I set the shared secret on my side to be the encrypted shared secret – I think that might work. Is the encrypted shared secret sent consistently – or is it dynamically created?

              If certificates are used to authenticate is the shared secret even sent – if it is then is it still encrypted?

                • Re: Can catalog tester credentails be changed to customize a Punchout request test?
                  zaheerbasra Apprentice

                  I would say use the following functions to Encrypt/Decrypt

                   

                   

                  /// <summary>

                          /// Encrypts the value.

                          /// </summary>

                          /// <param name="inputValue">The value to encrypt.</param>

                          /// <returns>The encrypted value.</returns>

                          public static string Encrypt(string inputValue)

                          {

                              if (provider == null)

                              {

                                  InitProvider();

                              }

                   

                   

                              MemoryStream ms = new MemoryStream();

                              CryptoStream cryto = new CryptoStream(ms, provider.CreateEncryptor(), CryptoStreamMode.Write);

                              byte[] valueToEncrypt = new ASCIIEncoding().GetBytes(inputValue);

                              cryto.Write(valueToEncrypt, 0, valueToEncrypt.Length);

                              cryto.FlushFinalBlock();

                              byte[] returnValue = ms.ToArray();

                              cryto.Close();

                              ms.Close();

                              return Convert.ToBase64String(returnValue);

                          }

                   

                   

                          /// <summary>

                          /// Decrypts the value.

                          /// </summary>

                          /// <param name="encryptedValue">The encrypted value.</param>

                          /// <returns>The decrypted value.</returns>

                          public static string Decrypt(string encryptedValue)

                          {

                              try

                              {

                                  if (provider == null)

                                  {

                                      InitProvider();

                                  }

                   

                   

                                  byte[] valueToDecrypt = Convert.FromBase64String(encryptedValue);

                                  MemoryStream ms = new MemoryStream();

                                  CryptoStream crypto = new CryptoStream(ms, provider.CreateDecryptor(), CryptoStreamMode.Write);

                                  crypto.Write(valueToDecrypt, 0, valueToDecrypt.Length);

                                  crypto.FlushFinalBlock();

                                  crypto.Close();

                                  return new UTF8Encoding().GetString(ms.ToArray());

                              }

                              catch (CryptographicException cryptoEx)

                              {

                                  ExceptionManager.HandleException(cryptoEx);

                                  return String.Empty;

                              }

                              catch (Exception ex)

                              {

                                  ExceptionManager.HandleException(ex);

                                  return String.Empty;

                              }

                          }

                   

                   

                   

                  But still you will need to configure the encrypted shared secrete in the Ariba supplier portal.