wokier / gwt-crypto

Automatically exported from code.google.com/p/gwt-crypto
8 stars 1 forks source link

SecureRandom should either allow algo switching or break API compatibility #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
SecureRandom getInstance is implemented as:

    public static SecureRandom getInstance(String algorithm) {
        return new SecureRandom();
    }

    public static SecureRandom getInstance(String algorithm, String provider) {
        return new SecureRandom();
    }

This is obviously misleading. I'd suggest one or all of:

a) throwing an exception ("Not implemented") if the caller requests a non-SHA1 
algorithm

b) deprecating the API compatibly methods and adding getInstance(), which is 
more accurate

c) implement the full range of hash algorithms

Thanks!

Original issue reported on code.google.com by quickte...@gmail.com on 2 Feb 2014 at 12:52