diff options
author | Roberto Tyley <roberto.tyley@gmail.com> | 2014-07-15 01:38:01 +0400 |
---|---|---|
committer | Roberto Tyley <roberto.tyley@gmail.com> | 2014-07-26 11:23:17 +0400 |
commit | 7cb752aaf746dc0b473afeb9e892b7fbc12666c5 (patch) | |
tree | cc4f91ddc18332b5adbe82e3fcb040d976c90105 /core/src/main/java/org/bouncycastle/asn1/nist | |
parent | 551830f8ea5177042af2c7dd1fc90888bc67387d (diff) |
Execute become-spongy.sh
https://github.com/rtyley/spongycastle/blob/3040af/become-spongy.sh
Diffstat (limited to 'core/src/main/java/org/bouncycastle/asn1/nist')
-rw-r--r-- | core/src/main/java/org/bouncycastle/asn1/nist/NISTNamedCurves.java | 99 | ||||
-rw-r--r-- | core/src/main/java/org/bouncycastle/asn1/nist/NISTObjectIdentifiers.java | 96 |
2 files changed, 0 insertions, 195 deletions
diff --git a/core/src/main/java/org/bouncycastle/asn1/nist/NISTNamedCurves.java b/core/src/main/java/org/bouncycastle/asn1/nist/NISTNamedCurves.java deleted file mode 100644 index ba7e5187..00000000 --- a/core/src/main/java/org/bouncycastle/asn1/nist/NISTNamedCurves.java +++ /dev/null @@ -1,99 +0,0 @@ -package org.bouncycastle.asn1.nist; - -import java.util.Enumeration; -import java.util.Hashtable; - -import org.bouncycastle.asn1.ASN1ObjectIdentifier; -import org.bouncycastle.asn1.sec.SECNamedCurves; -import org.bouncycastle.asn1.sec.SECObjectIdentifiers; -import org.bouncycastle.asn1.x9.X9ECParameters; -import org.bouncycastle.util.Strings; - -/** - * Utility class for fetching curves using their NIST names as published in FIPS-PUB 186-3 - */ -public class NISTNamedCurves -{ - static final Hashtable objIds = new Hashtable(); - static final Hashtable names = new Hashtable(); - - static void defineCurve(String name, ASN1ObjectIdentifier oid) - { - objIds.put(name, oid); - names.put(oid, name); - } - - static - { - defineCurve("B-571", SECObjectIdentifiers.sect571r1); - defineCurve("B-409", SECObjectIdentifiers.sect409r1); - defineCurve("B-283", SECObjectIdentifiers.sect283r1); - defineCurve("B-233", SECObjectIdentifiers.sect233r1); - defineCurve("B-163", SECObjectIdentifiers.sect163r2); - defineCurve("K-571", SECObjectIdentifiers.sect571k1); - defineCurve("K-409", SECObjectIdentifiers.sect409k1); - defineCurve("K-283", SECObjectIdentifiers.sect283k1); - defineCurve("K-233", SECObjectIdentifiers.sect233k1); - defineCurve("K-163", SECObjectIdentifiers.sect163k1); - defineCurve("P-521", SECObjectIdentifiers.secp521r1); - defineCurve("P-384", SECObjectIdentifiers.secp384r1); - defineCurve("P-256", SECObjectIdentifiers.secp256r1); - defineCurve("P-224", SECObjectIdentifiers.secp224r1); - defineCurve("P-192", SECObjectIdentifiers.secp192r1); - } - - public static X9ECParameters getByName( - String name) - { - ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier)objIds.get(Strings.toUpperCase(name)); - - if (oid != null) - { - return getByOID(oid); - } - - return null; - } - - /** - * return the X9ECParameters object for the named curve represented by - * the passed in object identifier. Null if the curve isn't present. - * - * @param oid an object identifier representing a named curve, if present. - */ - public static X9ECParameters getByOID( - ASN1ObjectIdentifier oid) - { - return SECNamedCurves.getByOID(oid); - } - - /** - * return the object identifier signified by the passed in name. Null - * if there is no object identifier associated with name. - * - * @return the object identifier associated with name, if present. - */ - public static ASN1ObjectIdentifier getOID( - String name) - { - return (ASN1ObjectIdentifier)objIds.get(Strings.toUpperCase(name)); - } - - /** - * return the named curve name represented by the given object identifier. - */ - public static String getName( - ASN1ObjectIdentifier oid) - { - return (String)names.get(oid); - } - - /** - * returns an enumeration containing the name strings for curves - * contained in this structure. - */ - public static Enumeration getNames() - { - return objIds.keys(); - } -} diff --git a/core/src/main/java/org/bouncycastle/asn1/nist/NISTObjectIdentifiers.java b/core/src/main/java/org/bouncycastle/asn1/nist/NISTObjectIdentifiers.java deleted file mode 100644 index e3613c68..00000000 --- a/core/src/main/java/org/bouncycastle/asn1/nist/NISTObjectIdentifiers.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.bouncycastle.asn1.nist; - -import org.bouncycastle.asn1.ASN1ObjectIdentifier; - -/** - * - * NIST: - * iso/itu(2) joint-assign(16) us(840) organization(1) gov(101) csor(3) - */ -public interface NISTObjectIdentifiers -{ - // - // nistalgorithms(4) - // - /** 2.16.840.1.101.3.4 -- algorithms */ - static final ASN1ObjectIdentifier nistAlgorithm = new ASN1ObjectIdentifier("2.16.840.1.101.3.4"); - - /** 2.16.840.1.101.3.4.2 */ - static final ASN1ObjectIdentifier hashAlgs = nistAlgorithm.branch("2"); - - /** 2.16.840.1.101.3.4.2.1 */ - static final ASN1ObjectIdentifier id_sha256 = hashAlgs.branch("1"); - /** 2.16.840.1.101.3.4.2.2 */ - static final ASN1ObjectIdentifier id_sha384 = hashAlgs.branch("2"); - /** 2.16.840.1.101.3.4.2.3 */ - static final ASN1ObjectIdentifier id_sha512 = hashAlgs.branch("3"); - /** 2.16.840.1.101.3.4.2.4 */ - static final ASN1ObjectIdentifier id_sha224 = hashAlgs.branch("4"); - /** 2.16.840.1.101.3.4.2.5 */ - static final ASN1ObjectIdentifier id_sha512_224 = hashAlgs.branch("5"); - /** 2.16.840.1.101.3.4.2.6 */ - static final ASN1ObjectIdentifier id_sha512_256 = hashAlgs.branch("6"); - - /** 2.16.840.1.101.3.4.1 */ - static final ASN1ObjectIdentifier aes = nistAlgorithm.branch("1"); - - /** 2.16.840.1.101.3.4.1.1 */ - static final ASN1ObjectIdentifier id_aes128_ECB = aes.branch("1"); - /** 2.16.840.1.101.3.4.1.2 */ - static final ASN1ObjectIdentifier id_aes128_CBC = aes.branch("2"); - /** 2.16.840.1.101.3.4.1.3 */ - static final ASN1ObjectIdentifier id_aes128_OFB = aes.branch("3"); - /** 2.16.840.1.101.3.4.1.4 */ - static final ASN1ObjectIdentifier id_aes128_CFB = aes.branch("4"); - /** 2.16.840.1.101.3.4.1.5 */ - static final ASN1ObjectIdentifier id_aes128_wrap = aes.branch("5"); - /** 2.16.840.1.101.3.4.1.6 */ - static final ASN1ObjectIdentifier id_aes128_GCM = aes.branch("6"); - /** 2.16.840.1.101.3.4.1.7 */ - static final ASN1ObjectIdentifier id_aes128_CCM = aes.branch("7"); - - /** 2.16.840.1.101.3.4.1.21 */ - static final ASN1ObjectIdentifier id_aes192_ECB = aes.branch("21"); - /** 2.16.840.1.101.3.4.1.22 */ - static final ASN1ObjectIdentifier id_aes192_CBC = aes.branch("22"); - /** 2.16.840.1.101.3.4.1.23 */ - static final ASN1ObjectIdentifier id_aes192_OFB = aes.branch("23"); - /** 2.16.840.1.101.3.4.1.24 */ - static final ASN1ObjectIdentifier id_aes192_CFB = aes.branch("24"); - /** 2.16.840.1.101.3.4.1.25 */ - static final ASN1ObjectIdentifier id_aes192_wrap = aes.branch("25"); - /** 2.16.840.1.101.3.4.1.26 */ - static final ASN1ObjectIdentifier id_aes192_GCM = aes.branch("26"); - /** 2.16.840.1.101.3.4.1.27 */ - static final ASN1ObjectIdentifier id_aes192_CCM = aes.branch("27"); - - /** 2.16.840.1.101.3.4.1.41 */ - static final ASN1ObjectIdentifier id_aes256_ECB = aes.branch("41"); - /** 2.16.840.1.101.3.4.1.42 */ - static final ASN1ObjectIdentifier id_aes256_CBC = aes.branch("42"); - /** 2.16.840.1.101.3.4.1.43 */ - static final ASN1ObjectIdentifier id_aes256_OFB = aes.branch("43"); - /** 2.16.840.1.101.3.4.1.44 */ - static final ASN1ObjectIdentifier id_aes256_CFB = aes.branch("44"); - /** 2.16.840.1.101.3.4.1.45 */ - static final ASN1ObjectIdentifier id_aes256_wrap = aes.branch("45"); - /** 2.16.840.1.101.3.4.1.46 */ - static final ASN1ObjectIdentifier id_aes256_GCM = aes.branch("46"); - /** 2.16.840.1.101.3.4.1.47 */ - static final ASN1ObjectIdentifier id_aes256_CCM = aes.branch("47"); - - // - // signatures - // - /** 2.16.840.1.101.3.4.3 */ - static final ASN1ObjectIdentifier id_dsa_with_sha2 = nistAlgorithm.branch("3"); - - /** 2.16.840.1.101.3.4.3.1 */ - static final ASN1ObjectIdentifier dsa_with_sha224 = id_dsa_with_sha2.branch("1"); - /** 2.16.840.1.101.3.4.3.2 */ - static final ASN1ObjectIdentifier dsa_with_sha256 = id_dsa_with_sha2.branch("2"); - /** 2.16.840.1.101.3.4.3.3 */ - static final ASN1ObjectIdentifier dsa_with_sha384 = id_dsa_with_sha2.branch("3"); - /** 2.16.840.1.101.3.4.3.4 */ - static final ASN1ObjectIdentifier dsa_with_sha512 = id_dsa_with_sha2.branch("4"); -} |