code: public byte[] encrypt(byte[] text, PublicKey key) throws MangooEncryptionException {
          Objects.requireNonNull(text, Required.PLAIN_TEXT.toString());
          Objects.requireNonNull(text, Required.PUBLIC_KEY.toString());
          
          byte[] encrypt = null;
          try {
              Cipher cipher = Cipher.getInstance(ENCRYPTION);
              cipher.init(Cipher.ENCRYPT_MODE, key);
              encrypt = cipher.doFinal(text);
          } catch (NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException | InvalidKeyException e) {
              throw new MangooEncryptionException("Failed to encrypt clear text with public key", e);
          }
  
          return encrypt;
      }
docs: Encrypt a text using public key
  
  @param text The plain text
  @param key The public key
  
  @return Encrypted text
  @throws MangooEncryptionException if encryption fails