/** * <p>Request a public key from the device for use with authentication. The device will respond by providing the public key calculated * based on the <a href="https://en.bitcoin.it/wiki/BIP_0032">BIP-32</a> deterministic wallet approach from * the master node.</p> * * <p>A BIP-32 chain code is derived from a combination of the URI and the index as follows:</p> * <ol> * <li>Concatenate the little endian representation of index with the URI (index + URI)</li> * <li>Compute the SHA256 hash of the result (256 bits)</li> * <li>Take first 128 bits of the hash and split it into four 32-bit numbers A, B, C, D</li> * <li>Set highest bits of numbers A, B, C, D to 1</li> * <li>Derive the hardened HD node m/13'/A'/B'/C'/D' according to BIP32 (e.g. bitwise-OR with 0x80000000)</li> * </ol> * * @param identityUri The identity URI (e.g. "https://user@multibit.org/trezor-connect") * @param index The index of the identity to use (default is zero) to allow for multiple identities on same path * @param ecdsaCurveName The ECDSA curve name to use for TLS (e.g. "nist256p1") leave null to use default * @param showDisplay True if the result should only be given on the device display */ public void requestPublicKeyForIdentity(URI identityUri, int index, String ecdsaCurveName, boolean showDisplay) { if (Strings.isNullOrEmpty(ecdsaCurveName)) { ecdsaCurveName = "nist256p1"; } // Set the FSM context context.beginGetPublicKeyForIdentityUseCase(identityUri, index, ecdsaCurveName, showDisplay); }