@Override
    public Mono<byte[]> readPublicKey() {
        return Mono.just(keyPair)
            .map(KeyPair::getPublic)
            .map(PublicKey::getEncoded);
    }
@Test
    void shouldDecryptMessageCorrectly() {
        final String message = "halo";

        var mono = service.readPublicKey()
            .map(pubKeyBytes -> {
                var pubKeySpec = new X509EncodedKeySpec(pubKeyBytes);
                try {
                    var keyFactory = KeyFactory.getInstance(RsaKeyService.ALGORITHM);
                    var pubKey = keyFactory.generatePublic(pubKeySpec);
                    var cipher = Cipher.getInstance(RsaKeyService.TRANSFORMATION);
                    cipher.init(Cipher.ENCRYPT_MODE, pubKey);
                    return cipher.doFinal(message.getBytes());
                } catch (NoSuchAlgorithmException | InvalidKeySpecException
                         | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException
                         | BadPaddingException e) {
                    throw Exceptions.propagate(e);
                }
            })
            .flatMap(service::decrypt)
            .map(String::new);

        StepVerifier.create(mono)
            .expectNext(message)
            .verifyComplete();
    }