Exemple #1
0
        IKeyring IKms.GetNewKeyring()
        {
            IKeyring keyring = new IKeyringImpl();

            keyring.Name = "Keyring " + _Keyrings.Count.ToString();
            return(keyring);
        }
Exemple #2
0
        protected virtual bool LoadKeysFile(XmlDocument doc)
        {
            bool result = false;

            _Keys.Clear();
            _Keyrings.Clear();

            //XmlDocument doc = new XmlDocument();
            try
            {
                //doc.Load(keysFile);

                XmlNode root     = doc.DocumentElement;
                XmlNode keys     = root["keys"];
                XmlNode keyrings = root["keyrings"];

                if (keys != null)
                {
                    foreach (XmlNode node in keys)
                    {
                        IKey key = new IKeyImpl(node);

                        _Keys.Add(key);
                    } //foreach (XmlNode node in keys)
                }
                if (keyrings != null)
                {
                    foreach (XmlNode node in keyrings)
                    {
                        IKeyring keyring = new IKeyringImpl(node);

                        _Keyrings.Add(keyring);
                    } //foreach (XmlNode node in keyrings)
                }
                result = true;
            }
            catch (Exception exc)
            {
                log.Debug(exc.ToString());
            }

            return(result);
        } //protected virtual bool LoadKeysFile(string keysFile)