Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cv5T7-0002Ds-GX for pgsql-jdbc@arkaria.postgresql.org; Mon, 03 Apr 2017 17:08:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cv5T6-000570-Ve for pgsql-jdbc@arkaria.postgresql.org; Mon, 03 Apr 2017 17:08:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cv5T6-00056r-HJ for pgsql-jdbc@postgresql.org; Mon, 03 Apr 2017 17:08:40 +0000 Received: from mail-wr0-x22c.google.com ([2a00:1450:400c:c0c::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cv5T3-0002Uc-Jx for pgsql-jdbc@postgresql.org; Mon, 03 Apr 2017 17:08:39 +0000 Received: by mail-wr0-x22c.google.com with SMTP id w43so177596009wrb.0 for ; Mon, 03 Apr 2017 10:08:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=8kdata-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=2q9bJoYaFiLiiUFN1vZtQhbS9fgAsuKIeQDmt/Zb+NM=; b=AkrA2uzM9lA9r3HZg2ME8pl+DOh4dGedmf2/VC6EmJDf8FZZVVD5IiD0KPd6FTZknr FOpobx0B/SD/+lCMTdcY+aWiYVEfQbg8uU+ZLXRSDDI1v7DYuQrZ0Xeoa8lE+AKZ+rLk oXPpe6Xf5DklXPbfH55xDa56VXlyUgy0WqFc6o3IZIxrYxZFROQL9wfqjnm+5VJPyB9v 6d0n7VCeNqUL3YvJQcKF46XJhmgjz8c/H2AIdk7m6ep9+D0wrIpjR8w2pE4f4YlN0iPl 8xjzFX2L2TpHuJkQx4W5QNZus6NxGS+qgCD2HXMQN6Js7zKI0Olwa5KAFps0kA508JvJ 0quA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=2q9bJoYaFiLiiUFN1vZtQhbS9fgAsuKIeQDmt/Zb+NM=; b=IqmyBPkpEzM/H0C/R8JwlELE88uGyTnzzWR5NWIF2EbmgQeLV6Alx75Ax2d/2leQ7s oAze+tQib/Ls2EREO9AXMSzEZDKn8jOALejbfQt6D3A5mskLZjWir+pPlBdHVUaKrZSn ES2Ytks4/hMrxFz7WVrUEh/yaDseT1tPuVT2El7l413SVuYJE2upYVtHCZaILwqpjHjJ UvJWMD1WK6GQaBgi1m4N3ZjwHsaFbEbSaPGasgifWO1BmhUe0bynCnnkDMbf0plilFYm YQ2rgK+3T1nplwKRrx0dT3YsvHofkzEn0exexDYLzE02ZrmCLnuK+47IrWCY4KHyHMDf uzNQ== X-Gm-Message-State: AFeK/H2/n9WsjvEDy5hnTbvuCcMYNPnj6m7Bi33zIjNwh8gvR8qQ7Eet yTBhvVueMFcVzw== X-Received: by 10.28.198.134 with SMTP id w128mr10229236wmf.80.1491239314026; Mon, 03 Apr 2017 10:08:34 -0700 (PDT) Received: from [10.0.10.100] (111.red-88-3-36.dynamicip.rima-tde.net. [88.3.36.111]) by smtp.gmail.com with ESMTPSA id v186sm15067715wmv.2.2017.04.03.10.08.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Apr 2017 10:08:33 -0700 (PDT) Subject: Re: RFC: Make new versions of pgjdbc Java8+ To: Mark Rotteveel , List References: <393118b3-4373-3e27-6f7e-0a7f764c9c81@8kdata.com> <9289bc74-5c08-c180-3a7a-943c79230824@8kdata.com> From: =?UTF-8?Q?=c3=81lvaro_Hern=c3=a1ndez_Tortosa?= Message-ID: <948b19b3-efaf-250d-61a6-68356a20772f@8kdata.com> Date: Mon, 3 Apr 2017 19:08:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On 03/04/17 17:28, Mark Rotteveel wrote: > On 2017-04-03 13:36, Álvaro Hernández Tortosa wrote: >> On 03/04/17 13:05, Dave Cramer wrote: >> Alvaro, >> >>> So why do you want to write in java 8 ? >> >> Not a comprehensive or ordered list, but a few reasons: >> >> - JDK comes with Base64 and cryptographic functions like PBKDF2 that >> are needed for SCRAM. In Java6 you either implement yourself or pull >> external dependencies. > > Base64 can also be done using javax.xml.bind.DatatypeConverter > (although that might be a dependency you don't want given it is not in > the default modules of Java 9 and is slated for removal in Java 10(?)), Exactly that's the point. Either I use a dependency now (commons-codec) of I use DatatypeConverter, which will become effectively a dependency with Java 9+. > and otherwise implementing base 64 encoding or decoding is not rocket > science. That would be IMVHO, a waste of developer bandwidth. Re-inventing the wheel is something I won't be doing at all. > PBKDF2 has been in Java for awhile (see > http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html, > search for PBKDF2WithHmacSHA1) Exception in thread "main" java.security.NoSuchAlgorithmException: PBKDF2WithHmacSHA256 SecretKeyFactory not available It is available for SHA1, but not SHA256 (which is the one used by Postgres). So it has to be coded by hand if using Java6. Álvaro -- Álvaro Hernández Tortosa ----------- <8K>data -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc