Skip to content

Instantly share code, notes, and snippets.

@typelogic
Created September 18, 2020 11:45
Show Gist options
  • Save typelogic/c75720c698b68b20ca72665b01de6281 to your computer and use it in GitHub Desktop.
Save typelogic/c75720c698b68b20ca72665b01de6281 to your computer and use it in GitHub Desktop.
loading.java
public IDPassReader(String alias, String configfile, String keystorePass)
throws IDPassException, IOException {
byte[] cfg = IDPassHelper.readKeyStoreEntry(alias, configfile, keystorePass);
byteArrays bas = byteArrays.parseFrom(cfg);
byteArray ba0 = bas.getVals(0); // keyset buf
byteArray ba1 = bas.getVals(1); // rootcertificates buf
byteArray ba2 = bas.getVals(2); // rootkey buf
m_keyset = KeySet.parseFrom(ba0.getVal().toByteArray());
m_rootcertificates = Certificates.parseFrom(ba1.getVal().toByteArray());
m_rootkey = ba2.getVal().toByteArray();
ctx = idpass_init(m_keyset.toByteArray(), m_rootcertificates != null ? m_rootcertificates.toByteArray() : null);
if (ctx == 0) {
throw new IDPassException("ID PASS Lite could not be initialized");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment