Keystore API shouldn't directly depend on internal types