Skip to content

Instantly share code, notes, and snippets.

View biafra23's full-sized avatar

Dirk Jäckel biafra23

View GitHub Profile


Verifying my identity on 0xe86935943315293154c7ad63296b4e1adac76364
private byte[] getDigestExtra(String toBeSigned, byte[] extra) throws NoSuchProviderException {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA1", "BC");
for (byte b : toBeSigned.getBytes()) {
System.out.println("b: " + Hex.toHexString(new byte[]{b}));
for (byte b : extra) {
System.out.println("b: " + Hex.toHexString(new byte[]{b}));
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;
biafra23 /
Created April 2, 2015 16:58

Keybase proof

I hereby claim:

  • I am biafra23 on github.
  • I am dirkjaeckel ( on keybase.
  • I have a public key whose fingerprint is 1C66 76AF 8572 DDE3 623B 7880 A258 970F A53E 4591

To claim this, I am signing this object: