Data validation code samples

Data validation code samples

Sample generated HTML is given below. When HTML is generated with an associated Website definition that has Data validation enabled, the generated HTML includes the comment /* Requires Authentication */. This provides sample data that has not been validated. You can add or remove what is needed from the data on your server, then validate the data and replace the value (either with the hash appended in the case of HMAC-SHA512, or just the raw encrypted PGP data).

For chat launches, it is best to use the function callback method to make an asynchronous call to your server to validate the chat and return the validated data.

Note: This is a self-launching anonymous function that is initially invoked indirectly by another function.

Sample Code ? Static Chat Button

<!-- BoldChat Live Chat Button HTML v5.00 (Type=Web,ChatButton=7.1 T,Website=Tilapia  -->
<div style="text-align: center; white-space: nowrap;">
<script type="text/javascript">
  var bccbId = Math.random(); document.write(unescape('%3Cdiv id=' + bccbId + '%3E%3C/div%3E'));
  var _bcvma = _bcvma || [];
  _bcvma.push(["setAccountID", "2307475884"]);
  _bcvma.push(["setParameter", "WebsiteID", "665123557559499"]);
  _bcvma.push(["setParameter", "SecureParameters", function(callback, type){ callback("61D2774599ABE6B36086DB65A32571F8D43F0D57170CFDE5A9CCF49AB38DD235FC151FD15F2F557163C73155E031C0B401D9124A5297746381791D589F7E6273Type=chat&ChatButtonDefID=58444531713309044&CustomURL=http://boldchat.com&VisitRef=a ref&VisitInfo=info&VisitEmail=email@gmail.com&VisitPhone=3166704000&URL=http://boldchat.com&ChatKey=Something unique to chat 1400085276518&VisitorKey=something unique to visitor&Expiration=1400085306518"); }]);
  _bcvma.push(["addStatic", {type: "chat", bdid: "58444531713309044", id: bccbId}]);
  var bcLoad = function(){
    if(window.bcLoaded) return; window.bcLoaded = true;
    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true;
    vms.src = ('https:'==document.location.protocol?'https://':'http://') + "vmss.boldchat.com/aid/2307475884/bc.vms4/vms.js";
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(vms, s);
  };
  if(window.pageViewer && pageViewer.load) pageViewer.load();
  else if(window.addEventListener) window.addEventListener('load', bcLoad, false);
  else window.attachEvent('onload', bcLoad);
</script>
 <span style="font-family: Arial; font-size: 8pt; color: black;"><a href="http://www.boldchat.com" style="text-decoration: none; color: black;">Live chat</a> by BoldChat</span>
</div>
<!-- /BoldChat Live Chat Button HTML v5.00 -->
Important: When you define the SecureParameters callback, you can use the type argument to specify three different types of events: chat, visit, and conversion. These event types are especially useful when you want to implement PGP encryption for only a selected event type. For example, you may want to encrypt chat events (when the customer clicks the chat button), but not every visit event (when the page with the chat window code loads). To define event types, you can do the following:
_bcvma.push(["setParameter", "SecureParameters", function(callback, type) {
            if (type == "chat") {
                callback(getChatPGPEncryption());
            } else if (type == "visit") {
                callback(getVisitPGPEncryption());
            }
            else if (type == "conversion") {
                callback(getConversionPGPEncyprtion());
            }
        }]);

Sample Code ? Text Chat Button

<!-- BoldChat Live Chat Button HTML v5.00 (Type=HTML,ChatWindow=7.1 T,Department=Billing,Website=Tilapia 2 -->
<div style="text-align: center; white-space: nowrap;">
<script type="text/javascript">
  var bccbId = Math.random(); document.write(unescape('%3Cdiv id=' + bccbId + '%3E%3C/div%3E'));
  window._bcvma = window._bcvma || [];
  _bcvma.push(["setAccountID", "2307475884"]);
  _bcvma.push(["setParameter", "WebsiteDefID", "665123557559499"]);
  _bcvma.push(["setParameter", "SecureParameters", function(callback, type){ callback("61D2774599ABE6B36086DB65A32571F8D43F0D57170CFDE5A9CCF49AB38DD235FC151FD15F2F557163C73155E031C0B401D9124A5297746381791D589F7E6273Type=chat&DepartmentID=2401021351553992858&ChatWindowID=8972751348093551233&CustomURL=http://boldchat.com&VisitRef=a ref&VisitInfo=info&VisitEmail=email@gmail.com&VisitPhone=3166704000&URL=http://boldchat.com&ChatKey=Something unique to chat 1400085276518&VisitorKey=something unique to visitor&Expiration=1400085306518"); }]);
  _bcvma.push(["addText", {type: "chat", department: "2401021351553992858", window: "8972751348093551233", available: "Chat is Available", unavailable: "Chat is Unavailable", id: bccbId}]);
  var bcLoad = function(){
    if(window.bcLoaded) return; window.bcLoaded = true;
    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true;
    vms.src = ('https:'==document.location.protocol?'https://':'http://') + "vmss.boldchat.com/aid/2307475884/bc.vms4/vms.js";
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(vms, s);
  };
  if(window.pageViewer && pageViewer.load) pageViewer.load();
  else if(window.addEventListener) window.addEventListener('load', bcLoad, false);
  else window.attachEvent('onload', bcLoad);
</script>
 <span style="font-family: Arial; font-size: 8pt; color: black;"><a href="http://www.boldchat.com" style="text-decoration: none; color: black;">Live chat</a> by BoldChat</span>
</div>
<!-- /BoldChat Live Chat Button HTML v5.00 -->

Sample Code - Customer Monitoring and Floating Chat Button

<!-- BoldChat Customer Monitor HTML v5.00 (Website=Tilapia ,Ruleset=7.1 My Custom Chat Invitation (Ryan),Floating Chat=7.1 (Ryan) floating,Floating Call=- None - -->
<script type="text/javascript">
  var _bcvma = _bcvma || [];
  _bcvma.push(["setAccountID", "2307475884"]);
  _bcvma.push(["setParameter", "WebsiteID", "665123557559499"]);
  _bcvma.push(["setParameter", "SecureParameters", function(callback, type){ callback("7F305427D701DB665E5A273F259C9B1E6EFED73B512CCB779E7D31FCA789FE8488AA179278ED2F0DF5845F209FD1CC6A0FF6E27BD2151F218F73F4BFF8BF375FType=chat&FloatingChatButtonDefID=660128588754890&VisitName=floating&CustomURL=http://boldchat.com&VisitRef=a ref&VisitInfo=info&VisitEmail=email@gmail.com&VisitPhone=3166704000&URL=http://boldchat.com&ChatKey=Something unique to chat 1400085276518&VisitorKey=something unique to visitor&Expiration=1400085306518"); }]);
  _bcvma.push(["addFloat", {type: "chat", id: "660128588754890"}]);
  _bcvma.push(["setParameter", "SecureParameters", "1AC03C6EF0B1C46A96DE1CD9250D40EB4DF5C105837162AA063FC2B2424DA4870B34F1FB17BC35EB60A6576B32E092F6153BD1F9219BBAB388571FFAA183EB64Type=visit&InvitationID=2076721744768832302&VisitName=invite&VisitRef=a ref&VisitInfo=info&VisitEmail=email@gmail.com&VisitPhone=3166704000&URL=http://boldchat.com&ReferrerURL=https://google.com&VisitorKey=something unique to visitor&Expiration=1400085306518"]);
  _bcvma.push(["pageViewed"]);
  var bcLoad = function(){
    if(window.bcLoaded) return; window.bcLoaded = true;
    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true;
    vms.src = ('https:'==document.location.protocol?'https://':'http://') + "vmss.boldchat.com/aid/2307475884/bc.vms4/vms.js";
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(vms, s);
  };
  if(window.pageViewer && pageViewer.load) pageViewer.load();
  else if(window.addEventListener) window.addEventListener('load', bcLoad, false);
  else window.attachEvent('onload', bcLoad);
</script>
<noscript>
<a href="http://www.boldchat.com" title="Live Chat Software" target="_blank"><img alt="Live Chat Software" src="https://vms.boldchat.com/aid/2307475884/bc.vmi?&amp;wdid=665123557559499&amp;secured=1AC03C6EF0B1C46A96DE1CD9250D40EB4DF5C105837162AA063FC2B2424DA4870B34F1FB17BC35EB60A6576B32E092F6153BD1F9219BBAB388571FFAA183EB64Type%3Dvisit%26InvitationID%3D2076721744768832302%26VisitName%3Dinvite%26VisitRef%3Da%20ref%26VisitInfo%3Dinfo%26VisitEmail%3Demail%40gmail.com%26VisitPhone%3D3166704000%26URL%3Dhttp%3A%2F%2Fboldchat.com%26ReferrerURL%3Dhttps%3A%2F%2Fgoogle.com%26VisitorKey%3Dsomething%20unique%20to%20visitor%26Expiration%3D1400085306518" border="0" width="1" height="1" /></a>
</noscript>
<!-- /BoldChat Customer Monitor HTML v5.00 -->

Sample Code ? Conversion Code

<!-- BoldChat Conversion Tracking HTML v5.00 (Website=Tilapia ,ConversionCode=account) -->
<script type="text/javascript">
  var _bcvma = _bcvma || [];
  _bcvma.push(["setAccountID", "2307475884"]);
  _bcvma.push(["addConversion", {
    SecureParameters: "53D52AC941C774AB8A0D0F575D12FE873A2CB861D57172A4E54BE897583E294E3B6B665129AF19DEAD041C6975E84D160B2B4FD0EC825A69FE606729F1F81776Type=conversion&ConversionCodeID=33221100&ConversionAmount=100.0&ConversionInfo=conversion info&ConversionRef=123456&Expiration=1400085306518",
    WebsiteDefID: "665123557559499"
  }]);
  if(window.pageViewer && pageViewer.conversion) pageViewer.conversion(_bcct[_bcct.length-1]);
  var bcLoad = function(){
    if(window.bcLoaded) return; window.bcLoaded = true;
    var vms = document.createElement("script"); vms.type = "text/javascript"; vms.async = true;
    vms.src = ('https:'==document.location.protocol?'https://':'http://') + "vmss.boldchat.com/aid/2307475884/bc.vms4/vms.js";
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(vms, s);
  };
  if(window.pageViewer && pageViewer.load) pageViewer.load();
  else if(window.addEventListener) window.addEventListener('load', bcLoad, false);
  else window.attachEvent('onload', bcLoad);
</script>
<noscript>
<a href="http://www.boldchat.com" title="Live Chat Software" target="_blank"><img alt="Live Chat Software" src="https://vms.boldchat.com/aid/2307475884/bc.vci?wdid=665123557559499&amp;secured=53D52AC941C774AB8A0D0F575D12FE873A2CB861D57172A4E54BE897583E294E3B6B665129AF19DEAD041C6975E84D160B2B4FD0EC825A69FE606729F1F81776Type%3Dconversion%26ConversionCodeID%3D33221100%26ConversionAmount%3D100.0%26ConversionInfo%3Dconversion%20info%26ConversionRef%3D123456%26Expiration%3D1400085306518" border="0" width="1" height="1" /></a>
</noscript>
<!-- /BoldChat Conversion Tracking HTML v5.00 -->

Sample Encryption and Hashing Applications

Here we use the Bouncy Castle APIs for performing PGP encryption: https://www.bouncycastle.org/

The methods illustrated in the samples below validate the parameter data by either encrypting it with the given PGP key or hashing it with the given hash key. The samples can be either embedded inline in jsp/asp.net or pulled out into utility classes/packages.

Java PGP

import java.util.Date;
import java.util.Iterator;
import java.net.URLEncoder;
import java.security.KeyPairGenerator;
import java.security.SecureRandom;
import java.security.Security;
import java.security.MessageDigest;
import org.bouncycastle.openpgp.*;
import org.bouncycastle.openpgp.operator.*;
import org.bouncycastle.openpgp.operator.bc.*;
import org.bouncycastle.bcpg.*;
import java.io.*;
public class PGPUtil {
	public static void main(String[] args) throws Exception {
		Long accountID = 2307475884L;
		Long websiteID = 665123557559499L;
		Long chatButtonID = 58444531713309044L;
		Long floatingChatButtonID = 660128588754890L;
		
		String url = "http://boldchat.com";
		String referrer = "http://google.com";
		String chatKey = "Something unique to chat " + String.valueOf(System.currentTimeMillis());;
		String visitorKey = "something unique to customer";
		String appendData =  "&ChatKey=" + chatKey + "&VisitorKey=" + visitorKey + "&Expiration=" + String.valueOf(System.currentTimeMillis()+30000);
		String customData = "&CustomURL=http://boldchat.com&VisitRef=a ref&VisitInfo=info&VisitEmail=email@gmail.com&VisitPhone=3166704000&URL="
			+ URLEncoder.encode(url, "UTF-8") + "&ReferrerURL=" + URLEncoder.encode(referrer, "UTF-8");
			
		String chat = "ChatButtonDefID=" + chatButtonID + customData + appendData;
		String invite = "FloatingChatButtonDefID=" + floatingChatButtonID + "&InvitationDefID=2076721744768832302&VisitName=floating" + customData + appendData;
		String conversion = "ConversionCodeID=33221100&ConversionAmount=100.0&ConversionInfo=conversion info" + appendData;
		
		
		byte[] encryptionKey = "-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nVersion: BCPG v1.50\r\n\r\nmQENBFNnvrgDCACe2sn+PAHxG/fhfHgFNu4ClODlvrduchKS49AsILEsgB+ie1Yf\r\n3gz1j2JrIcwsEg1AAVPOHJvoXBjLJMoA0TfJbtVXP9S/9Q6XGuQgtOb/HVP5mDTZ\r\nwEGDQH5l6Oxob/xWBD8SAjlQoHzPwEsJMigZiFdQMDCUMIlpcSje3Om2ZGhZ7Qc0\r\ncw0PgR9Wk3NWzX38RqMkxlL+l2UPHvRU3e3nPEDvJSbFORzsd7H/D6iAOG//fd0j\r\nU+dM+vZ7AI4XncFI/OcHxUPISEZK6whg0DjaOMGONZD3bO2RtaeOL+5DD+DMRscW\r\nlYwrGjA4PTQQ+Ba2fyaG73FEUlRdcdwmhmXbABEBAAG0CGJvbGRjaGF0iQE3BBAD\r\nCgAhBQJTZ765AhsDBAsJCAcGFQoIAgkLBAsJCAcGFQoIAgkLAAoJ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LEtVsipGdYuBcopLuq9stxSxfXpyugXkuwmLd9GkUIaCup1f7Um+FTy9q8c\r\nAyjFkOojM9V2Zooft2AHHesvm6HGwfyiLKd20WXtv8jBmmx7C44Q9LJksM5zzTeH\r\n97EHMM5TEZu6BjyMCwOrhnYNOae9AIrNFB+Dr6ynm0R6Fn+1xO82RG1VXK6i3di/\r\nh1r8t6jBiQEfBBgDCgAJBQJTZ773AhsMAAoJEKSji2mQmrGkg8gH/0YwswtvEQav\r\nu5GVfEGyFdTgiIkwHzhEDsWjr1KOMR6U+FcdcWvULCSsgXhWSaU4JalORsu93VB1\r\nELG5ju3dR3sPyocvOhxHjcJTSATYltVLlJGD3h46tVr5jo76zC0W3QjFoU8HMh63\r\nch9tY45/B3/UNRAY3ypapxZbnYKiYamAh4oKSjhE+aK3LS8gBIygVu93NQQ6mQiq\r\nc7SfnKxHqYfQaFe3d4ZQQ4oxb/f2NrJXxO22QZQv92o1YdOzYUYib8tFpXj9eps7\r\n3SldYNvQpSOTJLqwwruLwS45rEL+PbI9kEy08YiYE7qWC5JEwS2mhXiuAEFwst1P\r\n2sJmSsT9+mY=\r\n=tUYw\r\n-----END PGP PRIVATE KEY BLOCK-----\r\n".getBytes("UTF-8");
		char[] password = "boldchat".toCharArray();
		
		String encryptedChat = new String(PGPUtil.encrypt(chat.getBytes("UTF-8"), encryptionKey, signingKey, password), "UTF-8");
		String encryptedInvite = new String(PGPUtil.encrypt(invite.getBytes("UTF-8"), encryptionKey, signingKey, password), "UTF-8");
		String encryptedConversion = new String(PGPUtil.encrypt(conversion.getBytes("UTF-8"), encryptionKey, signingKey, password), "UTF-8");
	
		System.out.println("Encrypted Chat SecureParameters: " + encryptedChat);
		System.out.println("Encrypted Invite SecureParameters: " + encryptedInvite);
		System.out.println("Encrypted Conversion SecureParameters: " + encryptedConversion);
		
	}
	
    public static byte[] encrypt(byte[] data, byte[] publicKeyData, byte[] privateKeyData, char[] passwd) throws Exception
    {
    	ByteArrayOutputStream baos = new ByteArrayOutputStream();
        OutputStream out = new ArmoredOutputStream(baos);
 	    PGPPublicKey publicKey = null;
        InputStream inputStream = org.bouncycastle.openpgp.PGPUtil.getDecoderStream(new ByteArrayInputStream(publicKeyData));
        PGPPublicKeyRingCollection pgpPub = new PGPPublicKeyRingCollection(inputStream);
        OUTER1: for (Iterator i=pgpPub.getKeyRings(); i.hasNext();){
     	   for(Iterator j=((PGPPublicKeyRing)i.next()).getPublicKeys(); j.hasNext(); ){
         	   PGPPublicKey k = (PGPPublicKey) j.next();
         	   if(k.isEncryptionKey()) {
         		   publicKey = k;
         		   break OUTER1;
         	   }
     	   }
        }
        if(publicKey == null) throw new Exception("Can't find encryption key in key ring.");
        PGPSecretKeyRingCollection pgpSec = new PGPSecretKeyRingCollection(org.bouncycastle.openpgp.PGPUtil.getDecoderStream(new ByteArrayInputStream(privateKeyData)));
        PGPPrivateKey privateKey = null;
        PGPSecretKey secretKey = null;
        OUTER2: for(Iterator i=pgpSec.getKeyRings(); i.hasNext();){
        	PGPSecretKeyRing keyRing = (PGPSecretKeyRing) i.next();
        	for(Iterator j=keyRing.getSecretKeys(); j.hasNext();){
        		secretKey = (PGPSecretKey) j.next();
        		privateKey = secretKey.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(passwd));
        		break OUTER2;
        	}
        }
        if(secretKey == null) throw new Exception("Can't find signature key in key ring.");
        
        ByteArrayOutputStream cb = new ByteArrayOutputStream();
        PGPCompressedDataGenerator compressedGenerator = new PGPCompressedDataGenerator(PGPCompressedData.ZIP);
        OutputStream compressedOut = compressedGenerator.open(cb);
        PGPSignatureGenerator signatureGenerator = new PGPSignatureGenerator(new BcPGPContentSignerBuilder(secretKey.getPublicKey().getAlgorithm(), HashAlgorithmTags.SHA512));
        signatureGenerator.init(PGPSignature.BINARY_DOCUMENT, privateKey);
        for(Iterator i=secretKey.getPublicKey().getUserIDs(); i.hasNext();){
            PGPSignatureSubpacketGenerator spGen = new PGPSignatureSubpacketGenerator();
            spGen.setSignerUserID(false, (String) i.next());
            signatureGenerator.setHashedSubpackets(spGen.generate());
        }
        signatureGenerator.generateOnePassVersion(true).encode(compressedOut);
        PGPLiteralDataGenerator lgen = new PGPLiteralDataGenerator();
        OutputStream finalOut = lgen.open(compressedOut, PGPLiteralData.BINARY, "", new Date(), new byte[4096]);
        finalOut.write(data);
        signatureGenerator.update(data);
        finalOut.close();
        lgen.close();
        signatureGenerator.generate().encode(compressedOut);
        compressedGenerator.close();
        compressedOut.close();
        
        byte[] compressedData = cb.toByteArray();
        PGPEncryptedDataGenerator encryptedDataGenerator = new PGPEncryptedDataGenerator(new BcPGPDataEncryptorBuilder(PGPEncryptedData.AES_256).setWithIntegrityPacket(true).setSecureRandom(new SecureRandom()));
        encryptedDataGenerator.addMethod(new BcPublicKeyKeyEncryptionMethodGenerator(publicKey));
        OutputStream encryptedOut = encryptedDataGenerator.open(out, compressedData.length);
        encryptedOut.write(compressedData);
        encryptedOut.close();
        encryptedDataGenerator.close();
        out.close();
        
    	return baos.toByteArray();
    }
	
}

Java HMAC-SHA512

import java.net.URLEncoder;

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;

public class SHA512Util {

	public static void main(String[] args) throws Exception {
		Long chatButtonID = 58444531713309044L;
		Long floatingChatButtonID = 660128588754890L;
		Long expiration = System.currentTimeMillis();

		String url = "http://boldchat.com";
		String referrer = "http://google.com";
		String chatKey = "Something unique to chat " + expiration;
		String visitorKey = "something unique to customer";
		String appendData = "&ChatKey=" + chatKey + "&VisitorKey=" + visitorKey + "&Expiration=" + expiration;
		String customData = "&CustomURL=http://boldchat.com&VisitRef=a ref&VisitInfo=info&VisitEmail=email@gmail.com&VisitPhone=3166704000&URL=" + URLEncoder.encode(url, "UTF-8") + "&ReferrerURL=" + URLEncoder.encode(referrer, "UTF-8");

		String chat = "ChatButtonDefID=" + chatButtonID + customData + appendData;
		String invite = "FloatingChatButtonDefID=" + floatingChatButtonID + "&InvitationDefID=2076721744768832302&VisitName=floating" + customData + appendData;
		String conversion = "ConversionCodeID=33221100&ConversionAmount=100.0&ConversionInfo=conversion info" + appendData;

		String hashKey = "uWalJOJ8sOqcVuobDSwBIr7+KofZAq0K9/b0h/JviTYFqjpS/d0uIeewf/kgQLEM";

		String hashedChat = appendHash(chat, hashKey);
		String hashedInvite = appendHash(invite, hashKey);
		String hashedConversion = appendHash(conversion, hashKey);

		System.out.println("Hashed Chat SecureParameters: " + hashedChat);
		System.out.println("Hashed Invite SecureParameters: " + hashedInvite);
		System.out.println("Hashed Conversion SecureParameters: " + hashedConversion);
	}

	final protected static String HMAC_SHA512 = "HmacSHA512";

	public static String appendHash(String data, String hash) throws Exception {
		SecretKeySpec keySpec = new SecretKeySpec(hash.getBytes("UTF-8"), HMAC_SHA512);
		Mac hmac = Mac.getInstance(HMAC_SHA512);
		hmac.init(keySpec);
		byte[] hashBytes = hmac.doFinal(data.getBytes("UTF-8"));
		String hashText = bytesToHex(hashBytes);
		return hashText + data;
	}

	final protected static char[] hexArray = "0123456789ABCDEF".toCharArray();

	public static String bytesToHex(byte[] bytes) {
		char[] hexChars = new char[bytes.length * 2];
		for(int j = 0; j < bytes.length; j++) {
			int v = bytes[j] & 0xFF;
			hexChars[j * 2] = hexArray[v >>> 4];
			hexChars[j * 2 + 1] = hexArray[v & 0x0F];
		}
		return new String(hexChars);
	}
}

C# PGP

using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.IO;
using System.Security.Cryptography;
using Org.BouncyCastle.Bcpg;
using Org.BouncyCastle.Bcpg.OpenPgp;
class PgpUtil
{
	static void Main(string[] args)
	{
		long accountID = 2307475884L;
		long websiteID = 665123557559499L;
		long chatButtonID = 58444531713309044L;
		long floatingChatButtonID = 660128588754890L;
	
		long expiration = (long)((DateTime.Now - DateTime.Parse("1/1/1970 0:0:0 GMT", System.Globalization.DateTimeFormatInfo.InvariantInfo, System.Globalization.DateTimeStyles.None).ToUniversalTime()).TotalMilliseconds + 30000);
		string url = "http://boldchat.com";
		string referrer = "http://google.com";
		string chatKey = "Something unique to chat";
		string visitorKey = "something unique to customer";
		string appendData = "&ChatKey=" + chatKey + "&VisitorKey=" + visitorKey + "&Expiration=" + expiration;
		string customData = "&CustomURL=http://boldchat.com&VisitRef=a ref&VisitInfo=info&VisitEmail=email@gmail.com&VisitPhone=3166704000&URL="
			+ Uri.EscapeUriString(url) + "&ReferrerURL=" + Uri.EscapeUriString(referrer);
		
		string chat = "ChatButtonDefID=" + chatButtonID + customData + appendData;
		string invite = "FloatingChatButtonDefID=" + floatingChatButtonID + "&InvitationDefID=2076721744768832302&VisitName=floating" + customData + appendData;
		string conversion = "ConversionCodeID=33221100&ConversionAmount=100.0&ConversionInfo=conversion info" + appendData;
		
		byte[] encryptionKey = Encoding.UTF8.GetBytes("-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nVersion: BCPG v1.50\r\n\r\nmQENBFNnvrgDCACe2sn+PAHxG/fhfHgFNu4ClODlvrduchKS49AsILEsgB+ie1Yf\r\n3gz1j2JrIcwsEg1AAVPOHJvoXBjLJMoA0TfJbtVXP9S/9Q6XGuQgtOb/HVP5mDTZ\r\nwEGDQH5l6Oxob/xWBD8SAjlQoHzPwEsJMigZiFdQMDCUMIlpcSje3Om2ZGhZ7Qc0\r\ncw0PgR9Wk3NWzX38RqMkxlL+l2UPHvRU3e3nPEDvJSbFORzsd7H/D6iAOG//fd0j\r\nU+dM+vZ7AI4XncFI/OcHxUPISEZK6whg0DjaOMGONZD3bO2RtaeOL+5DD+DMRscW\r\nlYwrGjA4PTQQ+Ba2fyaG73FEUlRdcdwmhmXbABEBAAG0CGJvbGRjaGF0iQE3BBAD\r\nCgAhBQJTZ765AhsDBAsJCAcGFQoIAgkLBAsJCAcGFQoIAgkLAAoJECe+KX41fF/C\r\nO/kIAIEfLLyT9v9vyzgqpuaBh6l+6db0nKmaXB9wlYMWVtCPJ4XtG3paJXuuNbjw\r\nq5R0P+zwa2j5jDhkOHYasAxRvevxuIHjnkU/UIUshJR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