Skip to content

Instantly share code, notes, and snippets.

@ucjonathan
ucjonathan / AESGCMUpdateAAD2.java
Created December 19, 2019 12:34 — forked from praseodym/AESGCMUpdateAAD2.java
JDK8 AES-GCM code example
import javax.crypto.*;
import javax.crypto.spec.GCMParameterSpec;
import java.nio.ByteBuffer;
import java.security.SecureRandom;
import java.util.Arrays;
public class AESGCMUpdateAAD2 {
// AES-GCM parameters
public static final int AES_KEY_SIZE = 128; // in bits
@ucjonathan
ucjonathan / Adding UltraCart Hosted Fields to a Javascript Checkout
Created February 9, 2016 19:59 — forked from perrytew/Adding UltraCart Hosted Fields to a Javascript Checkout
Main block of code most apps will need to implement hosted fields, the new way to collect credit card numbers with UltraCart.
<!-- Changes -->
<!-- 10/1/2015 -->
<!-- Added a redundant check to make sure the hosted-fields js file actually loads first. this check has a document.write -->
<!-- call in it, so make sure the code below is at the end of the body, not in the head section. -->
<!-- 7/29/2015 -->
<!-- Added a hash of options to the setup call to allow for -->
<!-- some of the issues encountered using backbone.js checkouts. -->
<!--
options: { callback: somefunction, selectorContext: elementOrjQueryObj }