Beispiel #1
0
        public void AddProviderIdentities(IProvideSigning provider)
        {
            foreach (var identityID in provider.IdentityIDs)
            {
                Trace($"Add provider identity: {identityID}");

                identities.Add(new Identity(
                                   new PublicKey(provider.GetPublicKey(identityID)),
                                   provider as IManageIdentities));
            }

            FirePropertyChanged(nameof(Identities));
        }
Beispiel #2
0
        public async Task Register(IProvideSigning provider, int priority = 0)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            Trace($"Register with priority {priority}: {provider}");

            // Initialize provider
            await provider.Initialize();

            // Insert provider according to priority
            priority = Math.Min(priority, signProviders.Count);
            signProviders.Insert(priority, provider);

            FirePropertyChanged(nameof(DefaultIdentityProvider));

            // Add identities on hot plugin
            if (IsIdentitiesInitialized)
            {
                AddProviderIdentities(provider);
            }
        }