Ejemplo n.º 1
0
        private void AddRelyingParty(ServiceManagementWrapper acsWrapper, Action <LogInfo> logAction)
        {
            var tokenLifetime = this.relyingPartySpec.TokenLifetime();

            byte[]   signingCertBytes     = null;
            string   signingCertPassword  = null;
            DateTime?signingCertStartDate = null;
            DateTime?signingCertEndDate   = null;

            var signingCert = this.relyingPartySpec.SigningCertificate();

            if (signingCert != null)
            {
                signingCertBytes     = signingCert.Bytes();
                signingCertPassword  = signingCert.Password();
                signingCertStartDate = signingCert.StartDate();
                signingCertEndDate   = signingCert.EndDate();
            }

            this.LogMessage(logAction, string.Format("Adding Relying Party '{0}'", this.relyingPartySpec.Name()));
            acsWrapper.AddRelyingPartyWithKey(
                this.relyingPartySpec.Name(),
                this.relyingPartySpec.RealmAddress(),
                this.relyingPartySpec.ReplyAddress(),
                this.relyingPartySpec.SymmetricKey(),
                this.relyingPartySpec.GetTokenType(),
                (tokenLifetime == 0 ? Constants.RelyingPartyTokenLifetime : tokenLifetime),
                signingCertBytes,
                signingCertPassword,
                signingCertStartDate,
                signingCertEndDate,
                this.relyingPartySpec.EncryptionCertificate(),
                string.Empty,
                this.relyingPartySpec.AllowedIdentityProviders().ToArray());
            this.LogSavingChangesMessage(logAction);
        }