/// <summary>
        /// Initializes a new <see cref="RemoteIdentityOptions"/>.
        /// </summary>
        /// <param name="remoteDomainNameOverride">See <see cref="RemoteDomainNameOverride"/>.</param>
        /// <param name="remoteEnvironmentNameOverride">See <see cref="RemoteEnvironmentNameOverride"/>.</param>
        /// <param name="remotePartyNameOverride">See <see cref="RemotePartyNameOverride"/>.</param>
        public RemoteIdentityOptions(string?remoteDomainNameOverride      = null,
                                     string?remoteEnvironmentNameOverride = null,
                                     string?remotePartyNameOverride       = null)

        {
            Throw.CheckArgument(remoteDomainNameOverride == null || CoreApplicationIdentity.Builder.IsValidIdentifier(remoteDomainNameOverride));
            Throw.CheckArgument(string.IsNullOrEmpty(remoteEnvironmentNameOverride) || CoreApplicationIdentity.Builder.IsValidIdentifier(remoteEnvironmentNameOverride));
            Throw.CheckArgument(remotePartyNameOverride == null || Base64UrlHelper.IsBase64Url(remotePartyNameOverride));

            RemoteDomainNameOverride      = remoteDomainNameOverride;
            RemoteEnvironmentNameOverride = remoteEnvironmentNameOverride;
            RemotePartyNameOverride       = remotePartyNameOverride;
        }
Exemple #2
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;
        }