VirgilAccessTokenSigner { public byte[] generateTokenSignature(byte[] token, VirgilPrivateKey privateKey) throws CryptoException { if (privateKey == null) { throw new NullArgumentException("privateKey"); } return virgilCrypto.generateSignature(token, privateKey); } VirgilAccessTokenSigner();  VirgilAccessTokenSigner(VirgilCrypto virgilCrypto); byte[] generateTokenSignature(byte[] token, VirgilPrivateKey privateKey); String getAlgorithm(); VirgilCrypto getVirgilCrypto(); boolean verifyTokenSignature(byte[] signature, byte[] data, VirgilPublicKey publicKey);  }
@Test public void generateTokenSignature() throws CryptoException { byte[] signature = this.signer.generateTokenSignature(TOKEN, this.privateKey); assertNotNull(signature); }
@Test public void generateTokenSignature_nullKey() { assertThrows(NullArgumentException.class, () -> { this.signer.generateTokenSignature(TOKEN, null); }); }
@Test public void generateTokenSignature_nullToken() { assertThrows(NullArgumentException.class, () -> { this.signer.generateTokenSignature(null, this.privateKey); }); }
@Test public void verifyTokenSignature_nullKey() { assertThrows(NullArgumentException.class, () -> { this.signer.generateTokenSignature(TOKEN, null); }); }
@Test public void verifyTokenSignature_nullToken() { assertThrows(NullArgumentException.class, () -> { this.signer.generateTokenSignature(null, this.privateKey); }); }