コード例 #1
0
 static X962NamedCurves()
 {
     X962NamedCurves.objIds = Platform.CreateHashtable();
     X962NamedCurves.curves = Platform.CreateHashtable();
     X962NamedCurves.names  = Platform.CreateHashtable();
     X962NamedCurves.DefineCurve("prime192v1", X9ObjectIdentifiers.Prime192v1, X962NamedCurves.Prime192v1Holder.Instance);
     X962NamedCurves.DefineCurve("prime192v2", X9ObjectIdentifiers.Prime192v2, X962NamedCurves.Prime192v2Holder.Instance);
     X962NamedCurves.DefineCurve("prime192v3", X9ObjectIdentifiers.Prime192v3, X962NamedCurves.Prime192v3Holder.Instance);
     X962NamedCurves.DefineCurve("prime239v1", X9ObjectIdentifiers.Prime239v1, X962NamedCurves.Prime239v1Holder.Instance);
     X962NamedCurves.DefineCurve("prime239v2", X9ObjectIdentifiers.Prime239v2, X962NamedCurves.Prime239v2Holder.Instance);
     X962NamedCurves.DefineCurve("prime239v3", X9ObjectIdentifiers.Prime239v3, X962NamedCurves.Prime239v3Holder.Instance);
     X962NamedCurves.DefineCurve("prime256v1", X9ObjectIdentifiers.Prime256v1, X962NamedCurves.Prime256v1Holder.Instance);
     X962NamedCurves.DefineCurve("c2pnb163v1", X9ObjectIdentifiers.C2Pnb163v1, X962NamedCurves.C2pnb163v1Holder.Instance);
     X962NamedCurves.DefineCurve("c2pnb163v2", X9ObjectIdentifiers.C2Pnb163v2, X962NamedCurves.C2pnb163v2Holder.Instance);
     X962NamedCurves.DefineCurve("c2pnb163v3", X9ObjectIdentifiers.C2Pnb163v3, X962NamedCurves.C2pnb163v3Holder.Instance);
     X962NamedCurves.DefineCurve("c2pnb176w1", X9ObjectIdentifiers.C2Pnb176w1, X962NamedCurves.C2pnb176w1Holder.Instance);
     X962NamedCurves.DefineCurve("c2tnb191v1", X9ObjectIdentifiers.C2Tnb191v1, X962NamedCurves.C2tnb191v1Holder.Instance);
     X962NamedCurves.DefineCurve("c2tnb191v2", X9ObjectIdentifiers.C2Tnb191v2, X962NamedCurves.C2tnb191v2Holder.Instance);
     X962NamedCurves.DefineCurve("c2tnb191v3", X9ObjectIdentifiers.C2Tnb191v3, X962NamedCurves.C2tnb191v3Holder.Instance);
     X962NamedCurves.DefineCurve("c2pnb208w1", X9ObjectIdentifiers.C2Pnb208w1, X962NamedCurves.C2pnb208w1Holder.Instance);
     X962NamedCurves.DefineCurve("c2tnb239v1", X9ObjectIdentifiers.C2Tnb239v1, X962NamedCurves.C2tnb239v1Holder.Instance);
     X962NamedCurves.DefineCurve("c2tnb239v2", X9ObjectIdentifiers.C2Tnb239v2, X962NamedCurves.C2tnb239v2Holder.Instance);
     X962NamedCurves.DefineCurve("c2tnb239v3", X9ObjectIdentifiers.C2Tnb239v3, X962NamedCurves.C2tnb239v3Holder.Instance);
     X962NamedCurves.DefineCurve("c2pnb272w1", X9ObjectIdentifiers.C2Pnb272w1, X962NamedCurves.C2pnb272w1Holder.Instance);
     X962NamedCurves.DefineCurve("c2pnb304w1", X9ObjectIdentifiers.C2Pnb304w1, X962NamedCurves.C2pnb304w1Holder.Instance);
     X962NamedCurves.DefineCurve("c2tnb359v1", X9ObjectIdentifiers.C2Tnb359v1, X962NamedCurves.C2tnb359v1Holder.Instance);
     X962NamedCurves.DefineCurve("c2pnb368w1", X9ObjectIdentifiers.C2Pnb368w1, X962NamedCurves.C2pnb368w1Holder.Instance);
     X962NamedCurves.DefineCurve("c2tnb431r1", X9ObjectIdentifiers.C2Tnb431r1, X962NamedCurves.C2tnb431r1Holder.Instance);
 }
コード例 #2
0
        /**
         * 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 DerObjectIdentifier GetOid(string name)
        {
            DerObjectIdentifier oid = X962NamedCurves.GetOid(name);

            if (oid == null)
            {
                oid = SecNamedCurves.GetOid(name);
            }
            if (oid == null)
            {
                oid = NistNamedCurves.GetOid(name);
            }
            if (oid == null)
            {
                oid = TeleTrusTNamedCurves.GetOid(name);
            }
            if (oid == null)
            {
                oid = AnssiNamedCurves.GetOid(name);
            }
            if (oid == null)
            {
                oid = ECGost3410NamedCurves.GetOid(name);
            }
            if (oid == null)
            {
                oid = GMNamedCurves.GetOid(name);
            }
            return(oid);
        }
コード例 #3
0
        public static string GetName(DerObjectIdentifier oid)
        {
            string name = X962NamedCurves.GetName(oid);

            if (name == null)
            {
                name = SecNamedCurves.GetName(oid);
            }
            if (name == null)
            {
                name = NistNamedCurves.GetName(oid);
            }
            if (name == null)
            {
                name = TeleTrusTNamedCurves.GetName(oid);
            }
            if (name == null)
            {
                name = AnssiNamedCurves.GetName(oid);
            }
            if (name == null)
            {
                name = ECGost3410NamedCurves.GetName(oid);
            }
            if (name == null)
            {
                name = GMNamedCurves.GetName(oid);
            }
            return(name);
        }
コード例 #4
0
        /**
         * return a X9ECParameters object representing the passed in named
         * curve. The routine returns null if the curve is not present.
         *
         * @param name the name of the curve requested
         * @return an X9ECParameters object or null if the curve is not available.
         */
        public static X9ECParameters GetByName(string name)
        {
            X9ECParameters ecP = X962NamedCurves.GetByName(name);

            if (ecP == null)
            {
                ecP = SecNamedCurves.GetByName(name);
            }
            if (ecP == null)
            {
                ecP = NistNamedCurves.GetByName(name);
            }
            if (ecP == null)
            {
                ecP = TeleTrusTNamedCurves.GetByName(name);
            }
            if (ecP == null)
            {
                ecP = AnssiNamedCurves.GetByName(name);
            }
            if (ecP == null)
            {
                ecP = FromDomainParameters(ECGost3410NamedCurves.GetByName(name));
            }
            if (ecP == null)
            {
                ecP = GMNamedCurves.GetByName(name);
            }
            return(ecP);
        }
コード例 #5
0
        /**
         * return a X9ECParameters object representing the passed in named
         * curve.
         *
         * @param oid the object id of the curve requested
         * @return an X9ECParameters object or null if the curve is not available.
         */
        public static X9ECParameters GetByOid(DerObjectIdentifier oid)
        {
            X9ECParameters ecP = X962NamedCurves.GetByOid(oid);

            if (ecP == null)
            {
                ecP = SecNamedCurves.GetByOid(oid);
            }

            // NOTE: All the NIST curves are currently from SEC, so no point in redundant OID lookup

            if (ecP == null)
            {
                ecP = TeleTrusTNamedCurves.GetByOid(oid);
            }
            if (ecP == null)
            {
                ecP = AnssiNamedCurves.GetByOid(oid);
            }
            if (ecP == null)
            {
                ecP = FromDomainParameters(ECGost3410NamedCurves.GetByOid(oid));
            }
            if (ecP == null)
            {
                ecP = GMNamedCurves.GetByOid(oid);
            }
            return(ecP);
        }
コード例 #6
0
        public static X9ECParameters GetByName(string name)
        {
            DerObjectIdentifier oid = X962NamedCurves.GetOid(name);

            if (oid != null)
            {
                return(X962NamedCurves.GetByOid(oid));
            }
            return(null);
        }
コード例 #7
0
        public static X9ECParameters GetByOid(DerObjectIdentifier oid)
        {
            X9ECParameters byOid = X962NamedCurves.GetByOid(oid);

            if (byOid == null)
            {
                byOid = SecNamedCurves.GetByOid(oid);
            }
            if (byOid == null)
            {
                byOid = TeleTrusTNamedCurves.GetByOid(oid);
            }
            return(byOid);
        }
コード例 #8
0
        /**
         * return a X9ECParameters object representing the passed in named
         * curve. The routine returns null if the curve is not present.
         *
         * @param name the name of the curve requested
         * @return an X9ECParameters object or null if the curve is not available.
         */
        public static X9ECParameters GetByName(string name)
        {
            X9ECParameters ecP = X962NamedCurves.GetByName(name);

            if (ecP == null)
            {
                ecP = SecNamedCurves.GetByName(name);
            }

            if (ecP == null)
            {
                ecP = TeleTrusTNamedCurves.GetByName(name);
            }

            if (ecP == null)
            {
                ecP = NistNamedCurves.GetByName(name);
            }

            return(ecP);
        }
コード例 #9
0
        public static X9ECParameters GetByName(string name)
        {
            X9ECParameters byName = X962NamedCurves.GetByName(name);

            if (byName == null)
            {
                byName = SecNamedCurves.GetByName(name);
            }
            if (byName == null)
            {
                byName = NistNamedCurves.GetByName(name);
            }
            if (byName == null)
            {
                byName = TeleTrusTNamedCurves.GetByName(name);
            }
            if (byName == null)
            {
                byName = AnssiNamedCurves.GetByName(name);
            }
            return(byName);
        }