From b18a96cbfc300a3ee25fcf7f11d0609f8aff6d86 Mon Sep 17 00:00:00 2001 From: David Blacka Date: Sat, 19 May 2012 20:12:29 -0400 Subject: [PATCH] Change dnsjava algorithm references from DNSSEC. to DNSSEC.Algorithm. --- .../dnssec/security/DnsKeyAlgorithm.java | 32 +++++++++---------- .../dnssec/security/DnsKeyPair.java | 8 ++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/com/verisignlabs/dnssec/security/DnsKeyAlgorithm.java b/src/com/verisignlabs/dnssec/security/DnsKeyAlgorithm.java index 14920fd..a3b1b52 100644 --- a/src/com/verisignlabs/dnssec/security/DnsKeyAlgorithm.java +++ b/src/com/verisignlabs/dnssec/security/DnsKeyAlgorithm.java @@ -105,25 +105,25 @@ public class DnsKeyAlgorithm mIdToMnemonicMap = new HashMap(); // Load the standard DNSSEC algorithms. - addAlgorithm(DNSSEC.RSAMD5, new Entry("MD5withRSA", RSA)); - addMnemonic("RSAMD5", DNSSEC.RSAMD5); + addAlgorithm(DNSSEC.Algorithm.RSAMD5, new Entry("MD5withRSA", RSA)); + addMnemonic("RSAMD5", DNSSEC.Algorithm.RSAMD5); - addAlgorithm(DNSSEC.DH, new Entry("", DH)); - addMnemonic("DH", DNSSEC.DH); + addAlgorithm(DNSSEC.Algorithm.DH, new Entry("", DH)); + addMnemonic("DH", DNSSEC.Algorithm.DH); - addAlgorithm(DNSSEC.DSA, new Entry("SHA1withDSA", DSA)); - addMnemonic("DSA", DNSSEC.DSA); + addAlgorithm(DNSSEC.Algorithm.DSA, new Entry("SHA1withDSA", DSA)); + addMnemonic("DSA", DNSSEC.Algorithm.DSA); - addAlgorithm(DNSSEC.RSASHA1, new Entry("SHA1withRSA", RSA)); - addMnemonic("RSASHA1", DNSSEC.RSASHA1); - addMnemonic("RSA", DNSSEC.RSASHA1); + addAlgorithm(DNSSEC.Algorithm.RSASHA1, new Entry("SHA1withRSA", RSA)); + addMnemonic("RSASHA1", DNSSEC.Algorithm.RSASHA1); + addMnemonic("RSA", DNSSEC.Algorithm.RSASHA1); // Load the (now) standard aliases - addAlias(DNSSEC.DSA_NSEC3_SHA1, "DSA-NSEC3-SHA1", DNSSEC.DSA); - addAlias(DNSSEC.RSA_NSEC3_SHA1, "RSA-NSEC3-SHA1", DNSSEC.RSASHA1); + addAlias(DNSSEC.Algorithm.DSA_NSEC3_SHA1, "DSA-NSEC3-SHA1", DNSSEC.Algorithm.DSA); + addAlias(DNSSEC.Algorithm.RSA_NSEC3_SHA1, "RSA-NSEC3-SHA1", DNSSEC.Algorithm.RSASHA1); // Also recognize the BIND 9.6 mnemonics - addMnemonic("NSEC3DSA", DNSSEC.DSA_NSEC3_SHA1); - addMnemonic("NSEC3RSASHA1", DNSSEC.RSA_NSEC3_SHA1); + addMnemonic("NSEC3DSA", DNSSEC.Algorithm.DSA_NSEC3_SHA1); + addMnemonic("NSEC3RSASHA1", DNSSEC.Algorithm.RSA_NSEC3_SHA1); // Algorithms added by RFC 5702. // NOTE: these algorithms aren't available in Java 1.4's sunprovider @@ -221,11 +221,11 @@ public class DnsKeyAlgorithm switch (baseType(algorithm)) { case RSA: - return DNSSEC.RSASHA1; + return DNSSEC.Algorithm.RSASHA1; case DSA: - return DNSSEC.DSA; + return DNSSEC.Algorithm.DSA; case DH: - return DNSSEC.DH; + return DNSSEC.Algorithm.DH; default: return UNKNOWN; } diff --git a/src/com/verisignlabs/dnssec/security/DnsKeyPair.java b/src/com/verisignlabs/dnssec/security/DnsKeyPair.java index 802cba6..0b94970 100644 --- a/src/com/verisignlabs/dnssec/security/DnsKeyPair.java +++ b/src/com/verisignlabs/dnssec/security/DnsKeyPair.java @@ -333,15 +333,15 @@ public class DnsKeyPair if (pk != null) { // currently, alg 5 is the default over alg 1 (RSASHA1). - if (pk instanceof RSAPublicKey) return DNSSEC.RSASHA1; - if (pk instanceof DSAPublicKey) return DNSSEC.DSA; + if (pk instanceof RSAPublicKey) return DNSSEC.Algorithm.RSASHA1; + if (pk instanceof DSAPublicKey) return DNSSEC.Algorithm.DSA; } PrivateKey priv = getPrivate(); if (priv != null) { - if (priv instanceof RSAPrivateKey) return DNSSEC.RSASHA1; - if (priv instanceof DSAPrivateKey) return DNSSEC.DSA; + if (priv instanceof RSAPrivateKey) return DNSSEC.Algorithm.RSASHA1; + if (priv instanceof DSAPrivateKey) return DNSSEC.Algorithm.DSA; } return -1;