/** * <p>Reset the context back to an attached state (clear device information and transition to connected)</p> */ public void resetToAttached() { log.debug("Reset to 'attached'"); // Clear relevant information resetAll(); // Perform the state change currentState = HardwareWalletStates.newAttachedState(); // No high level event for this state }
/** * <p>Continue the "change PIN" use case with the provision of the current PIN</p> * * @param pin The PIN */ public void continueChangePIN_PIN(String pin) { log.debug("Continue 'change PIN' use case (provide PIN)"); // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmChangePINState(); // Issue starting message to elicit the event client.pinMatrixAck(pin); }
/** * <p>Continue the "cipher key" use case with the provision of the current PIN</p> * * @param pin The PIN */ public void continueCipherKey_PIN(String pin) { log.debug("Continue 'cipher key' use case (provide PIN)"); // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmCipherKeyState(); // Issue starting message to elicit the event client.pinMatrixAck(pin); }
/** * <p>Continue the "get public key for identity" use case with the provision of the current PIN</p> * * @param pin The PIN */ public void continueGetPublicKeyForIdentityUseCase_PIN(String pin) { log.debug("Continue 'get public key for identity' use case (provide PIN)"); // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmGetPublicKeyForIdentityState(); // Issue starting message to elicit the event client.pinMatrixAck(pin); }
/** * <p>Continue the "create wallet on device" use case with the provision of a PIN (either first or second)</p> * * @param pin The PIN */ public void continueCreateWallet_PIN(String pin) { log.debug("Continue 'create wallet on device' use case (provide PIN)"); // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmPINState(); // Issue starting message to elicit the event client.pinMatrixAck(pin); }
/** * <p>Continue the "get public key" use case with the provision of the current PIN</p> * * @param pin The PIN */ public void continueGetPublicKeyUseCase_PIN(String pin) { log.debug("Continue 'get public key' use case (provide PIN)"); // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmGetPublicKeyState(); // Issue starting message to elicit the event client.pinMatrixAck(pin); }
/** * <p>Continue the "get deterministic hierarchy" use case with the provision of the current PIN</p> * * @param pin The PIN */ public void continueGetDeterministicHierarchyUseCase_PIN(String pin) { log.debug("Continue 'get deterministic hierarchy' use case (provide PIN)"); // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmGetDeterministicHierarchyState(); // Issue starting message to elicit the event client.pinMatrixAck(pin); }
/** * <p>Continue the "create wallet on device" use case with the provision of entropy</p> * * @param entropy The 256 bits of entropy to include */ public void continueCreateWallet_Entropy(byte[] entropy) { log.debug("Continue 'create wallet on device' use case (provide entropy)"); // Track the use case currentUseCase = ContextUseCase.PROVIDE_ENTROPY; // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmEntropyState(); // Issue starting message to elicit the event client.entropyAck(entropy); }
/** * <p>Begin the "get address" use case</p> * * @param account The plain account number (0 gives maximum compatibility) * @param keyPurpose The key purpose (RECEIVE_FUNDS,CHANGE,REFUND,AUTHENTICATION etc) * @param index The plain index of the required address * @param showDisplay True if the device should display the same address to allow the user to verify no tampering has occurred (recommended). */ public void beginGetAddressUseCase(int account, KeyChain.KeyPurpose keyPurpose, int index, boolean showDisplay) { log.debug("Begin 'get address' use case"); // Clear relevant information resetAllButFeatures(); // Track the use case currentUseCase = ContextUseCase.REQUEST_ADDRESS; // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmGetAddressState(); // Issue starting message to elicit the event client.getAddress( account, keyPurpose, index, showDisplay ); }
/** * Sets to "confirm load" state */ public void setToConfirmLoadState() { // Set the event receiving state currentState = HardwareWalletStates.newConfirmLoadState(); // Expect the specification to be in place LoadWalletSpecification specification = loadWalletSpecification.get(); // Issue starting message to elicit the event client.loadDevice( specification.getLanguage(), specification.getLabel(), specification.getSeedPhrase(), specification.getPin() ); }
/** * <p>Continue the "get public key for identity" use case with the provision of the current passphrase</p> * * @param passphrase The passphrase */ public void continueGetPublicKeyForIdentityUseCase_Passphrase(String passphrase) { log.debug("Continue 'get public key for identity' use case (provide passphrase)"); // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmGetPublicKeyForIdentityState(); // Issue starting message to elicit the event client.passphraseAck(passphrase); }
/** * <p>Continue the "load wallet" use case with the provision of a PIN (either first or second)</p> * * @param pin The PIN */ public void continueLoadWallet_PIN(String pin) { log.debug("Continue 'create wallet on device' use case (provide PIN)"); // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmPINState(); // Issue starting message to elicit the event client.pinMatrixAck(pin); }
/** * <p>Begin the "get public key" use case</p> * * @param account The plain account number (0 gives maximum compatibility) * @param keyPurpose The key purpose (RECEIVE_FUNDS,CHANGE,REFUND,AUTHENTICATION etc) * @param index The plain index of the required address */ public void beginGetPublicKeyUseCase(int account, KeyChain.KeyPurpose keyPurpose, int index) { log.debug("Begin 'get public key' use case"); // Clear relevant information resetAllButFeatures(); // Track the use case currentUseCase = ContextUseCase.REQUEST_PUBLIC_KEY; // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmGetPublicKeyState(); // Issue starting message to elicit the event client.getPublicKey( account, keyPurpose, index ); }
/** * <p>Begin the "get deterministic hierarchy" use case</p> * * @param childNumbers The child numbers describing the required chain from the master node including hardening bits */ public void beginGetDeterministicHierarchyUseCase(List<ChildNumber> childNumbers) { log.debug("Begin 'get deterministic hierarchy' use case"); // Clear relevant information resetAllButFeatures(); // Track the use case currentUseCase = ContextUseCase.REQUEST_DETERMINISTIC_HIERARCHY; // Store the overall context parameters this.childNumbers = Optional.of(childNumbers); // Set the event receiving state currentState = HardwareWalletStates.newConfirmGetDeterministicHierarchyState(); // Issue starting message to elicit the event // In this case we start with the master node (empty list) to enable building up a complete // hierarchy in case of hardened child numbers that require private keys to create client.getDeterministicHierarchy(Lists.<ChildNumber>newArrayList()); }
/** * <p>Begin the "get public key" use case</p> * * @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 beginGetPublicKeyForIdentityUseCase(URI identityUri, int index, String ecdsaCurveName, boolean showDisplay) { log.debug("Begin 'get public key for identity' use case"); // Clear relevant information resetAllButFeatures(); // Track the use case currentUseCase = ContextUseCase.REQUEST_PUBLIC_KEY_FOR_IDENTITY; // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmGetPublicKeyForIdentityState(); // Issue starting message to elicit the event client.getPublicKeyForIdentity( identityUri, index, ecdsaCurveName, showDisplay ); }
currentState = HardwareWalletStates.newConfirmCipherKeyState();
/** * <p>Change or remove the device PIN.</p> * * @param remove True if an existing PIN should be removed */ public void beginChangePIN(boolean remove) { log.debug("Begin 'change PIN' use case"); // Clear relevant information resetAllButFeatures(); // Track the use case currentUseCase = ContextUseCase.CHANGE_PIN; // Store the overall context parameters // Set the event receiving state currentState = HardwareWalletStates.newConfirmChangePINState(); // Issue starting message to elicit the event client.changePIN(remove); }