X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2FdbObjects%2FDigest.java;h=1bf2b77b74b84a593b0ad8bee0c5f8da6beb9d50;hb=af932253d612fbbbf1dcead6107df6fc53896282;hp=edd8dcad907dd54d7fce1a5952aae09f541fcefd;hpb=e409ba881965634f63f0b67824bc93dda4ec4327;p=gigi.git diff --git a/src/org/cacert/gigi/dbObjects/Digest.java b/src/org/cacert/gigi/dbObjects/Digest.java index edd8dcad..1bf2b77b 100644 --- a/src/org/cacert/gigi/dbObjects/Digest.java +++ b/src/org/cacert/gigi/dbObjects/Digest.java @@ -1,19 +1,31 @@ package org.cacert.gigi.dbObjects; +import org.cacert.gigi.output.template.Outputable; +import org.cacert.gigi.output.template.TranslateCommand; +import org.cacert.gigi.output.template.SprintfCommand; +import java.util.Arrays; + public enum Digest { - SHA256("Currently recommended, because the other algorithms" + " might break on some older versions of the GnuTLS library" + " (older than 3.x) still shipped in Debian for example."), SHA384(null), SHA512("Highest protection against hash collision attacks of the algorithms offered here."); + SHA256(new SprintfCommand("Most compatible choice (see {0}documentation{1} for details)", Arrays.asList("!'", "!'"))), + SHA384("Best matched with ECC P-384"), + SHA512("Highest collision resistance, recommended"); - private final String exp; + private final Outputable exp; private Digest(String explanation) { - exp = explanation; + exp = new TranslateCommand(explanation); + } + + private Digest(Outputable exp) { + this.exp = exp; } - public String getExp() { + public Outputable getExp() { return exp; } public static Digest getDefault() { - return SHA256; + return SHA512; } + }