Skip to content

Instantly share code, notes, and snippets.

@typelogic
Created September 18, 2020 11:44
Show Gist options
  • Save typelogic/b3f3c40eebb77df7d75888ab75373e7f to your computer and use it in GitHub Desktop.
Save typelogic/b3f3c40eebb77df7d75888ab75373e7f to your computer and use it in GitHub Desktop.
saveconfig.java
public boolean saveConfiguration(String alias, String keystorefile, String keystorePass)
{
byteArray ba1 = byteArray.newBuilder().setVal(ByteString.copyFrom(m_keyset.toByteArray())).build();
byteArray ba2 = byteArray.newBuilder().setVal(ByteString.copyFrom(m_rootcertificates.toByteArray())).build();
byteArray ba3 = byteArray.newBuilder().setVal(ByteString.copyFrom(m_rootkey)).build();
byteArrays bas = byteArrays.newBuilder()
.addVals(ba1)
.addVals(ba2)
.addVals(ba3)
.build();
return IDPassHelper.addKeyStoreEntry(alias, bas.toByteArray(), keystorefile, keystorePass);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment