VirgilCardCrypto { public VirgilPublicKey importPublicKey(byte[] data) throws CryptoException { return virgilCrypto.importPublicKey(data); } VirgilCardCrypto();  VirgilCardCrypto(VirgilCrypto virgilCrypto); byte[] exportPublicKey(VirgilPublicKey publicKey); byte[] computeSha512(byte[] data); byte[] generateSignature(byte[] data, VirgilPrivateKey privateKey); VirgilCrypto getVirgilCrypto(); VirgilPublicKey importPublicKey(byte[] data); boolean verifySignature(byte[] signature, byte[] data, VirgilPublicKey publicKey);  }
@Test public void importPublicKey() throws CryptoException { byte[] exportedKeyData = this.cardCrypto.exportPublicKey(this.publicKey); VirgilPublicKey importedPublicKey = this.cardCrypto.importPublicKey(exportedKeyData); assertNotNull(importedPublicKey); }
@Test public void importPublicKey_null() { assertThrows(NullArgumentException.class, () -> { this.cardCrypto.importPublicKey(null); }); }
@Test public void importPublicKey_wrongData() { assertThrows(CryptoException.class, () -> { this.cardCrypto.importPublicKey(TEST_DATA); }); }