YkneoBitcoinSoft implements YkneoBitcoin { @Override public byte[] getHeader() throws PinModeLockedException, IOException, NoKeyLoadedException { ensurePin(PinMode.USER); ensureKey(); byte[] header = new byte[13]; System.arraycopy(master.getRootKey().serializePrivate(), 0, header, 0, 13); return header; } YkneoBitcoinSoft(); @Override byte[] exportExtendedPublicKey(); @Override String getAppletVersion(); @Override boolean isKeyLoaded(); @Override void unlockUser(String pin); @Override void unlockAdmin(String pin); @Override boolean isUserUnlocked(); @Override boolean isAdminUnlocked(); @Override void setUserPin(String oldPin, String newPin); @Override void setAdminPin(String oldPin, String newPin); @Override void resetUserPin(String newPin); @Override byte[] getHeader(); @Override void setAdminRetryCount(int attempts); @Override void setUserRetryCount(int attempts); @Override byte[] getPublicKey(boolean compress, int... index); @Override byte[] sign(byte[] hash, int... index); @Override byte[] generateMasterKeyPair(boolean allowExport, boolean returnPrivateKey, boolean testnetKey); @Override void importExtendedKeyPair(byte[] extendedPrivateKey, boolean allowExport);  }
@Test public void testGetHeader() throws Exception { testImportExtended(); neo.unlockUser(userPin); String expectedHeader = "0488ade4000000000000000000"; String header = HEX.encode(neo.getHeader()); assertEquals(expectedHeader, header); }