pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Hernández Tortosa <aht@8kdata.com>
To: Mark Rotteveel <mark@lawinegevaar.nl>
To: List <pgsql-jdbc@postgresql.org>
Subject: Re: RFC: Make new versions of pgjdbc Java8+
Date: Mon, 3 Apr 2017 19:08:32 +0200
Message-ID: <948b19b3-efaf-250d-61a6-68356a20772f@8kdata.com> (raw)
In-Reply-To: <c31a60d22defa61236f0526e76966f4e@lawinegevaar.nl>
References: <393118b3-4373-3e27-6f7e-0a7f764c9c81@8kdata.com>
	<dab17d70-29b7-9445-ab0a-98a502318f0a@hogranch.com>
	<c98f5172-bc5f-5987-a2c6-03766547469a@8kdata.com>
	<CADK3HHKyRxDKGcagk9ooqjCL=DHnieE_rp2MLTnpCpTUOn9p+A@mail.gmail.com>
	<9289bc74-5c08-c180-3a7a-943c79230824@8kdata.com>
	<c31a60d22defa61236f0526e76966f4e@lawinegevaar.nl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>



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



view thread (37+ messages)  latest in thread

Message-ID: <948b19b3-efaf-250d-61a6-68356a20772f@8kdata.com>
Permalink:  ../948b19b3-efaf-250d-61a6-68356a20772f@8kdata.com/
Also on:    postgresql.org/message-id/948b19b3-efaf-250d-61a6-68356a20772f@8kdata.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: aht@8kdata.com, mark@lawinegevaar.nl
  Subject: Re: RFC: Make new versions of pgjdbc Java8+
  In-Reply-To: <948b19b3-efaf-250d-61a6-68356a20772f@8kdata.com>
  References: <393118b3-4373-3e27-6f7e-0a7f764c9c81@8kdata.com> <dab17d70-29b7-9445-ab0a-98a502318f0a@hogranch.com> <c98f5172-bc5f-5987-a2c6-03766547469a@8kdata.com> <CADK3HHKyRxDKGcagk9ooqjCL=DHnieE_rp2MLTnpCpTUOn9p+A@mail.gmail.com> <9289bc74-5c08-c180-3a7a-943c79230824@8kdata.com> <c31a60d22defa61236f0526e76966f4e@lawinegevaar.nl> <948b19b3-efaf-250d-61a6-68356a20772f@8kdata.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox