Пример #1
0
        /// <summary>
        /// Ges a list ofr all available ec curves
        /// </summary>
        /// <returns>the list of all ec curves</returns>
        public ObservableCollection <string> GetEcCurves(EcCurveProvider provider)
        {
            var list = new ObservableCollection <string>();

            switch (provider)
            {
            case EcCurveProvider.NIST:
                foreach (var key in ecCurves.Keys)
                {
                    if (key.Contains("nist"))
                    {
                        list.Add(key);
                    }
                }
                break;

            case EcCurveProvider.TELETRUST:
                foreach (var key in ecCurves.Keys)
                {
                    if (key.Contains("brain"))
                    {
                        list.Add(key);
                    }
                }
                break;
            }
            return(list);
        }
Пример #2
0
        /// <summary>
        /// Gets a list of all available ec curves
        /// </summary>
        /// <returns>the list of all ec curves</returns>
        public ObservableCollection <string> GetEcCurves(EcCurveProvider provider)
        {
            var    list    = new ObservableCollection <string>();
            string keyName = string.Empty;

            switch (provider)
            {
            case EcCurveProvider.NIST:
                keyName = "nist";
                break;

            case EcCurveProvider.TELETRUST:
                keyName = "brain";
                break;
            }

            //extract the keys containing the key name
            foreach (var key in ecCurves.Keys)
            {
                if (key.Contains(keyName))
                {
                    list.Add(key);
                }
            }
            return(list);
        }
Пример #3
0
        /// <summary>
        /// Gets a list of all available ec curves
        /// </summary>
        /// <returns>the list of all ec curves</returns>
        public ObservableCollection <string> GetEcCurves(EcCurveProvider provider)
        {
            var curves = Gost3410NamedParameters.Names.GetEnumerator();
            var list   = new ObservableCollection <string>();

            while (curves.MoveNext())
            {
                list.Add((string)curves.Current);
            }

            //Sort list alphabeticaly
            list = new ObservableCollection <string>(list.OrderBy(x => x).ToList());

            return(list);
        }
        /// <summary>
        /// Gets a list of available ec curves
        /// </summary>
        /// <returns>the list of all ec curves</returns>
        public ObservableCollection <string> GetCurves(EcCurveProvider provider)
        {
            IEnumerator curves = null;

            switch (provider)
            {
            case EcCurveProvider.SEC:
                curves = SecNamedCurves.Names.GetEnumerator();
                break;

            case EcCurveProvider.NIST:
                curves = NistNamedCurves.Names.GetEnumerator();
                break;

            case EcCurveProvider.TELETRUST:
                curves = TeleTrusTNamedCurves.Names.GetEnumerator();
                break;

            case EcCurveProvider.ANSSI:
                curves = AnssiNamedCurves.Names.GetEnumerator();
                break;

            case EcCurveProvider.GOST3410:
                curves = ECGost3410NamedCurves.Names.GetEnumerator();
                break;

            case EcCurveProvider.GM:
                curves = GMNamedCurves.Names.GetEnumerator();
                break;
            }
            var list = new ObservableCollection <string>();

            while (curves.MoveNext())
            {
                list.Add((string)curves.Current);
            }

            //sort list
            list = new ObservableCollection <string>(list.OrderBy(x => x));
            return(list);
        }
Пример #5
0
 /// <summary>
 /// Gets a list of all available ec curves
 /// </summary>
 /// <returns>the list of all ec curves</returns>
 public ObservableCollection <string> GetEcCurves(EcCurveProvider provider)
 {
     return(new ObservableCollection <string> {
         "Ed448"
     });
 }
Пример #6
0
 /// <summary>
 /// Gets a list of all available ec curves
 /// </summary>
 /// <returns>the list of all ec curves</returns>
 public ObservableCollection <string> GetEcCurves(EcCurveProvider provider)
 {
     return(GetCurves(provider));
 }