Change dnsjava algorithm references from DNSSEC.<alg> to DNSSEC.Algorithm.<alg>

This commit is contained in:
David Blacka 2012-05-19 20:12:29 -04:00
parent cc0873a336
commit b18a96cbfc
2 changed files with 20 additions and 20 deletions

View File

@ -105,25 +105,25 @@ public class DnsKeyAlgorithm
mIdToMnemonicMap = new HashMap<Integer, String>(); mIdToMnemonicMap = new HashMap<Integer, String>();
// Load the standard DNSSEC algorithms. // Load the standard DNSSEC algorithms.
addAlgorithm(DNSSEC.RSAMD5, new Entry("MD5withRSA", RSA)); addAlgorithm(DNSSEC.Algorithm.RSAMD5, new Entry("MD5withRSA", RSA));
addMnemonic("RSAMD5", DNSSEC.RSAMD5); addMnemonic("RSAMD5", DNSSEC.Algorithm.RSAMD5);
addAlgorithm(DNSSEC.DH, new Entry("", DH)); addAlgorithm(DNSSEC.Algorithm.DH, new Entry("", DH));
addMnemonic("DH", DNSSEC.DH); addMnemonic("DH", DNSSEC.Algorithm.DH);
addAlgorithm(DNSSEC.DSA, new Entry("SHA1withDSA", DSA)); addAlgorithm(DNSSEC.Algorithm.DSA, new Entry("SHA1withDSA", DSA));
addMnemonic("DSA", DNSSEC.DSA); addMnemonic("DSA", DNSSEC.Algorithm.DSA);
addAlgorithm(DNSSEC.RSASHA1, new Entry("SHA1withRSA", RSA)); addAlgorithm(DNSSEC.Algorithm.RSASHA1, new Entry("SHA1withRSA", RSA));
addMnemonic("RSASHA1", DNSSEC.RSASHA1); addMnemonic("RSASHA1", DNSSEC.Algorithm.RSASHA1);
addMnemonic("RSA", DNSSEC.RSASHA1); addMnemonic("RSA", DNSSEC.Algorithm.RSASHA1);
// Load the (now) standard aliases // Load the (now) standard aliases
addAlias(DNSSEC.DSA_NSEC3_SHA1, "DSA-NSEC3-SHA1", DNSSEC.DSA); addAlias(DNSSEC.Algorithm.DSA_NSEC3_SHA1, "DSA-NSEC3-SHA1", DNSSEC.Algorithm.DSA);
addAlias(DNSSEC.RSA_NSEC3_SHA1, "RSA-NSEC3-SHA1", DNSSEC.RSASHA1); addAlias(DNSSEC.Algorithm.RSA_NSEC3_SHA1, "RSA-NSEC3-SHA1", DNSSEC.Algorithm.RSASHA1);
// Also recognize the BIND 9.6 mnemonics // Also recognize the BIND 9.6 mnemonics
addMnemonic("NSEC3DSA", DNSSEC.DSA_NSEC3_SHA1); addMnemonic("NSEC3DSA", DNSSEC.Algorithm.DSA_NSEC3_SHA1);
addMnemonic("NSEC3RSASHA1", DNSSEC.RSA_NSEC3_SHA1); addMnemonic("NSEC3RSASHA1", DNSSEC.Algorithm.RSA_NSEC3_SHA1);
// Algorithms added by RFC 5702. // Algorithms added by RFC 5702.
// NOTE: these algorithms aren't available in Java 1.4's sunprovider // NOTE: these algorithms aren't available in Java 1.4's sunprovider
@ -221,11 +221,11 @@ public class DnsKeyAlgorithm
switch (baseType(algorithm)) switch (baseType(algorithm))
{ {
case RSA: case RSA:
return DNSSEC.RSASHA1; return DNSSEC.Algorithm.RSASHA1;
case DSA: case DSA:
return DNSSEC.DSA; return DNSSEC.Algorithm.DSA;
case DH: case DH:
return DNSSEC.DH; return DNSSEC.Algorithm.DH;
default: default:
return UNKNOWN; return UNKNOWN;
} }

View File

@ -333,15 +333,15 @@ public class DnsKeyPair
if (pk != null) if (pk != null)
{ {
// currently, alg 5 is the default over alg 1 (RSASHA1). // currently, alg 5 is the default over alg 1 (RSASHA1).
if (pk instanceof RSAPublicKey) return DNSSEC.RSASHA1; if (pk instanceof RSAPublicKey) return DNSSEC.Algorithm.RSASHA1;
if (pk instanceof DSAPublicKey) return DNSSEC.DSA; if (pk instanceof DSAPublicKey) return DNSSEC.Algorithm.DSA;
} }
PrivateKey priv = getPrivate(); PrivateKey priv = getPrivate();
if (priv != null) if (priv != null)
{ {
if (priv instanceof RSAPrivateKey) return DNSSEC.RSASHA1; if (priv instanceof RSAPrivateKey) return DNSSEC.Algorithm.RSASHA1;
if (priv instanceof DSAPrivateKey) return DNSSEC.DSA; if (priv instanceof DSAPrivateKey) return DNSSEC.Algorithm.DSA;
} }
return -1; return -1;