I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 03cec7fd authored by zzz's avatar zzz
Browse files

just check availability once

parent 1238001a
No related branches found
No related tags found
No related merge requests found
...@@ -95,6 +95,7 @@ public enum SigType { ...@@ -95,6 +95,7 @@ public enum SigType {
private final SigAlgo base; private final SigAlgo base;
private final String digestName, algoName, since; private final String digestName, algoName, since;
private final AlgorithmParameterSpec params; private final AlgorithmParameterSpec params;
private final boolean isAvail;
SigType(int cod, int pubLen, int privLen, int hLen, int sLen, SigAlgo baseAlgo, SigType(int cod, int pubLen, int privLen, int hLen, int sLen, SigAlgo baseAlgo,
String mdName, String aName, AlgorithmParameterSpec pSpec, String supportedSince) { String mdName, String aName, AlgorithmParameterSpec pSpec, String supportedSince) {
...@@ -108,6 +109,7 @@ public enum SigType { ...@@ -108,6 +109,7 @@ public enum SigType {
algoName = aName; algoName = aName;
params = pSpec; params = pSpec;
since = supportedSince; since = supportedSince;
isAvail = x_isAvailable();
} }
/** the unique identifier for this type */ /** the unique identifier for this type */
...@@ -180,6 +182,10 @@ public enum SigType { ...@@ -180,6 +182,10 @@ public enum SigType {
* @return true if supported in this JVM * @return true if supported in this JVM
*/ */
public boolean isAvailable() { public boolean isAvailable() {
return isAvail;
}
private boolean x_isAvailable() {
if (DSA_SHA1 == this) if (DSA_SHA1 == this)
return true; return true;
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment