Example #1
0
        public LocalParty(string domainName,
                          string environmentName,
                          string partyName,
                          StandardKeysConfiguration keysConfiguration,
                          IApplicationIdentityClock clock,
                          IKeyStore?keyStore,
                          TrustedPartyConfiguration?localConfiguration = null)
            : base(domainName, environmentName, partyName, localConfiguration)
        {
            Throw.CheckArgument(domainName != null && CoreApplicationIdentity.Builder.IsValidIdentifier(domainName));
            Throw.CheckArgument(environmentName != null && (environmentName == "" || CoreApplicationIdentity.Builder.IsValidIdentifier(environmentName)));
            Throw.CheckArgument(partyName != null && Base64UrlHelper.IsBase64Url(partyName));

            _keyExchangeRequired = new PerfectEventSender <KeyExchangeRequiredEventArgs>();
            _remotes             = new ConcurrentDictionary <string, RemoteParty>();
            _exposed             = _remotes.AsIReadOnlyDictionary <string, RemoteParty, IRemoteParty>();
            KeyFactory           = new KeyFactory(keysConfiguration, clock.Clock);
            KeyStore             = keyStore;
            DomainName           = domainName;
            EnvironmentName      = environmentName;
            _appClock            = clock;
        }