VirgilCardCrypto { public byte[] generateSignature(byte[] data, VirgilPrivateKey privateKey) throws CryptoException { return virgilCrypto.generateSignature(data, privateKey); } 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 generateSignature() throws CryptoException { byte[] signature = this.cardCrypto.generateSignature(TEST_DATA, this.privateKey); assertNotNull(signature); }
@Test public void generateSignature_nullData() { assertThrows(NullArgumentException.class, () -> { this.cardCrypto.generateSignature(null, this.privateKey); }); }
@Test public void generateSignature_nullKey() { assertThrows(NullArgumentException.class, () -> { this.cardCrypto.generateSignature(TEST_DATA, null); }); }
@Test @Disabled public void generateSignature_wrongKey() { VirgilPrivateKey key = new VirgilPrivateKey() { }; assertThrows(CryptoException.class, () -> { this.cardCrypto.generateSignature(TEST_DATA, key); }); }