Skip to content

Instantly share code, notes, and snippets.

@biafra23
Created May 16, 2017 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biafra23/d9a353aec0da1108a31b0bd9011ff977 to your computer and use it in GitHub Desktop.
Save biafra23/d9a353aec0da1108a31b0bd9011ff977 to your computer and use it in GitHub Desktop.
Signature signer = Signature.getInstance(Signature.ALG_ECDSA_SHA, false);
signer.init(cardPrivateKey, Signature.MODE_SIGN);
byte[] sigBuffer = new byte[100];
short size = signer.sign(buffer, offset, length, sigBuffer, (short) 0);
byte[] result = new byte[size];
Util.arrayCopyNonAtomic(sigBuffer, (short) 0, result, (short) 0, size);
return result;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment