GetByOid() public static method

public static GetByOid ( DerObjectIdentifier oid ) : X9ECParameters
oid DerObjectIdentifier
return X9ECParameters
Beispiel #1
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 = GMNamedCurves.GetByOid(oid);
            }
            return(ecP);
        }
        public static X9ECParameters GetByName(string name)
        {
            DerObjectIdentifier oid = X962NamedCurves.GetOid(name);

            if (oid != null)
            {
                return(X962NamedCurves.GetByOid(oid));
            }
            return(null);
        }
Beispiel #3
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);
        }