YkneoBitcoinSoft implements YkneoBitcoin { @Override public byte[] exportExtendedPublicKey() throws PinModeLockedException, IOException, OperationNotPermittedException, NoKeyLoadedException { ensurePin(PinMode.ADMIN); ensureKey(); if(!allowExport) { throw new OperationNotPermittedException(); } return master.getRootKey().serializePublic(); } 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 testExportExtended() throws Exception { testImportExtended(); String expectedPubKey = "0488b21e000000000000000000873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d5080339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2"; String pubKey = HEX.encode(neo.exportExtendedPublicKey()); assertEquals(expectedPubKey, pubKey); }