code: @SneakyThrows
      protected static byte[] encodeInternal(final String data, final PublicKey publicKey,
                                             final RegisteredService registeredService) {
          val cipher = initializeCipherBasedOnServicePublicKey(publicKey, registeredService);
          if (cipher != null) {
              LOGGER.debug("Initialized cipher successfully. Proceeding to finalize...");
              return cipher.doFinal(data.getBytes(StandardCharsets.UTF_8));
          }
          return null;
      }
docs: Encode internally, meant to be called by extensions.
  Default behavior will encode the data based on the
  registered service public key's algorithm using {@link javax.crypto.Cipher}.
  
  @param data              the data
  @param publicKey         the public key
  @param registeredService the registered service
  @return a byte[] that contains the encrypted result