• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# INonceStore类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中INonceStore的典型用法代码示例。如果您正苦于以下问题:C# INonceStore类的具体用法?C# INonceStore怎么用?C# INonceStore使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



INonceStore类属于命名空间,在下文中一共展示了INonceStore类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OAuthChannel

		/// <summary>
		/// Initializes a new instance of the <see cref="OAuthChannel"/> class.
		/// </summary>
		/// <param name="signingBindingElement">The binding element to use for signing.</param>
		/// <param name="store">The web application store to use for nonces.</param>
		/// <param name="tokenManager">The token manager instance to use.</param>
		internal OAuthChannel(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, IServiceProviderTokenManager tokenManager)
			: this(
			signingBindingElement,
			store,
			tokenManager,
			new OAuthServiceProviderMessageFactory(tokenManager)) {
		}
开发者ID:jsmale,项目名称:dotnetopenid,代码行数:13,代码来源:OAuthChannel.cs


示例2: OAuthChannel

        /// <summary>
        /// Initializes a new instance of the <see cref="OAuthChannel"/> class.
        /// </summary>
        /// <param name="signingBindingElement">The binding element to use for signing.</param>
        /// <param name="store">The web application store to use for nonces.</param>
        /// <param name="tokenManager">The token manager instance to use.</param>
        /// <param name="isConsumer">A value indicating whether this channel is being constructed for a Consumer (as opposed to a Service Provider).</param>
        internal OAuthChannel(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, ITokenManager tokenManager, bool isConsumer)
            : this(signingBindingElement,
			store,
			tokenManager,
			isConsumer ? (IMessageFactory)new OAuthConsumerMessageFactory() : new OAuthServiceProviderMessageFactory(tokenManager))
        {
        }
开发者ID:vrushalid,项目名称:dotnetopenid,代码行数:14,代码来源:OAuthChannel.cs


示例3: RecordFeatureAndDependencyUse

		/// <summary>
		/// Records the feature and dependency use.
		/// </summary>
		/// <param name="value">The consumer or service provider.</param>
		/// <param name="service">The service.</param>
		/// <param name="tokenManager">The token manager.</param>
		/// <param name="nonceStore">The nonce store.</param>
		internal static void RecordFeatureAndDependencyUse(object value, ServiceProviderHostDescription service, ITokenManager tokenManager, INonceStore nonceStore) {
			Requires.NotNull(value, "value");
			Requires.NotNull(service, "service");
			Requires.NotNull(tokenManager, "tokenManager");

			// In release builds, just quietly return.
			if (value == null || service == null || tokenManager == null) {
				return;
			}

			if (Reporting.Enabled && Reporting.Configuration.IncludeFeatureUsage) {
				StringBuilder builder = new StringBuilder();
				builder.Append(value.GetType().Name);
				builder.Append(" ");
				builder.Append(tokenManager.GetType().Name);
				if (nonceStore != null) {
					builder.Append(" ");
					builder.Append(nonceStore.GetType().Name);
				}
				builder.Append(" ");
				builder.Append(service.UserAuthorizationEndpoint != null ? service.UserAuthorizationEndpoint.Location.AbsoluteUri : string.Empty);
				Reporting.ObservedFeatures.Add(builder.ToString());
				Reporting.Touch();
			}
		}
开发者ID:Balamir,项目名称:DotNetOpenAuth,代码行数:32,代码来源:OAuthReporting.cs


示例4: StandardReplayProtectionBindingElement

        /// <summary>
        /// Initializes a new instance of the <see cref="StandardReplayProtectionBindingElement"/> class.
        /// </summary>
        /// <param name="nonceStore">The store where nonces will be persisted and checked.</param>
        /// <param name="allowEmptyNonces">A value indicating whether zero-length nonces will be allowed.</param>
        internal StandardReplayProtectionBindingElement(INonceStore nonceStore, bool allowEmptyNonces)
        {
            ErrorUtilities.VerifyArgumentNotNull(nonceStore, "nonceStore");

            this.nonceStore = nonceStore;
            this.AllowZeroLengthNonce = allowEmptyNonces;
        }
开发者ID:vrushalid,项目名称:dotnetopenid,代码行数:12,代码来源:StandardReplayProtectionBindingElement.cs


示例5: Serialize

		/// <summary>
		/// Serializes this <see cref="Token"/> instance as a string that can be
		/// included as part of a return_to variable in a querystring. 
		/// This string is cryptographically signed to protect against tampering.
		/// </summary>
		public string Serialize(INonceStore store) {
			using (MemoryStream dataStream = new MemoryStream()) {
				if (!persistSignature(store)) {
					Debug.Assert(!persistNonce(Endpoint, store), "Without a signature, a nonce is meaningless.");
					dataStream.WriteByte(0); // there will be NO signature.
					StreamWriter writer = new StreamWriter(dataStream);
					Endpoint.Serialize(writer);
					writer.Flush();
					return Convert.ToBase64String(dataStream.ToArray());
				} else {
					using (HashAlgorithm shaHash = createHashAlgorithm(store))
					using (CryptoStream shaStream = new CryptoStream(dataStream, shaHash, CryptoStreamMode.Write)) {
						StreamWriter writer = new StreamWriter(shaStream);
						Endpoint.Serialize(writer);
						if (persistNonce(Endpoint, store))
							writer.WriteLine(Nonce.Code);
						
						writer.Flush();
						shaStream.Flush();
						shaStream.FlushFinalBlock();

						byte[] hash = shaHash.Hash;
						byte[] data = new byte[1 + hash.Length + dataStream.Length];
						data[0] = 1; // there is a signature
						Buffer.BlockCopy(hash, 0, data, 1, hash.Length);
						Buffer.BlockCopy(dataStream.ToArray(), 0, data, 1 + hash.Length, (int)dataStream.Length);

						return Convert.ToBase64String(data);
					}
				}
			}
		}
开发者ID:Belxjander,项目名称:Asuna,代码行数:37,代码来源:Token.cs


示例6: AuthorizationServerHost

 public AuthorizationServerHost(ICryptoKeyStore cryptoKeyStore, INonceStore nonceStore, IClientRepository clientRepository, IUserRepository userRepository)
 {
     _cryptoKeyStore = cryptoKeyStore;
     _nonceStore = nonceStore;
     _clientRepository = clientRepository;
     _userRepository = userRepository;
 }
开发者ID:ptsurko,项目名称:basicoauth2server,代码行数:7,代码来源:AuthorizationServerHost.cs


示例7: RecordFeatureAndDependencyUse

		/// <summary>
		/// Records the feature and dependency use.
		/// </summary>
		/// <param name="value">The consumer or service provider.</param>
		/// <param name="service">The service.</param>
		/// <param name="tokenManager">The token manager.</param>
		/// <param name="nonceStore">The nonce store.</param>
		internal static void RecordFeatureAndDependencyUse(object value, ServiceProviderDescription service, ITokenManager tokenManager, INonceStore nonceStore) {
			Contract.Requires(value != null);
			Contract.Requires(service != null);
			Contract.Requires(tokenManager != null);

			// In release builds, just quietly return.
			if (value == null || service == null || tokenManager == null) {
				return;
			}

			if (Reporting.Enabled && Reporting.Configuration.IncludeFeatureUsage) {
				StringBuilder builder = new StringBuilder();
				builder.Append(value.GetType().Name);
				builder.Append(" ");
				builder.Append(tokenManager.GetType().Name);
				if (nonceStore != null) {
					builder.Append(" ");
					builder.Append(nonceStore.GetType().Name);
				}
				builder.Append(" ");
				builder.Append(service.Version);
				builder.Append(" ");
				builder.Append(service.UserAuthorizationEndpoint);
				Reporting.ObservedFeatures.Add(builder.ToString());
				Reporting.Touch();
			}
		}
开发者ID:437072341,项目名称:dotnetopenid,代码行数:34,代码来源:OAuthReporting.cs


示例8: ReturnToNonceBindingElement

		/// <summary>
		/// Initializes a new instance of the <see cref="ReturnToNonceBindingElement"/> class.
		/// </summary>
		/// <param name="nonceStore">The nonce store to use.</param>
		/// <param name="securitySettings">The security settings of the RP.</param>
		internal ReturnToNonceBindingElement(INonceStore nonceStore, RelyingPartySecuritySettings securitySettings) {
			Contract.Requires<ArgumentNullException>(nonceStore != null);
			Contract.Requires<ArgumentNullException>(securitySettings != null);

			this.nonceStore = nonceStore;
			this.securitySettings = securitySettings;
		}
开发者ID:enslam,项目名称:dotnetopenid,代码行数:12,代码来源:ReturnToNonceBindingElement.cs


示例9: ReturnToNonceBindingElement

		/// <summary>
		/// Initializes a new instance of the <see cref="ReturnToNonceBindingElement"/> class.
		/// </summary>
		/// <param name="nonceStore">The nonce store to use.</param>
		/// <param name="securitySettings">The security settings of the RP.</param>
		internal ReturnToNonceBindingElement(INonceStore nonceStore, RelyingPartySecuritySettings securitySettings) {
			Requires.NotNull(nonceStore, "nonceStore");
			Requires.NotNull(securitySettings, "securitySettings");

			this.nonceStore = nonceStore;
			this.securitySettings = securitySettings;
		}
开发者ID:437072341,项目名称:dotnetopenid,代码行数:12,代码来源:ReturnToNonceBindingElement.cs


示例10: WsseRequestInterceptor

 /// <summary>
 /// Initializes a new instance of the <see cref="WsseRequestInterceptor"/> class.
 /// </summary>
 /// <param name="provider">The provider.</param>
 /// <param name="realm">The realm.</param>
 /// <param name="timestampRangevalidator">The timestamp rangevalidator.</param>
 /// <param name="nonceStore">The nonce store.</param>
 public WsseRequestInterceptor(IPasswordProvider provider, string realm, ITimestampRangeValidator timestampRangevalidator, INonceStore nonceStore)
     : base(false)
 {
     TimestampRangeValidator = timestampRangevalidator;
     NonceStore = nonceStore;
     Provider = provider;
     Realm = realm;
 }
开发者ID:javicrespo,项目名称:WcfRestAuth,代码行数:15,代码来源:WsseRequestInterceptor.cs


示例11: OAuthChannel

        /// <summary>
        /// Initializes a new instance of the <see cref="OAuthChannel"/> class.
        /// </summary>
        /// <param name="signingBindingElement">The binding element to use for signing.</param>
        /// <param name="store">The web application store to use for nonces.</param>
        /// <param name="tokenManager">The ITokenManager instance to use.</param>
        /// <param name="messageTypeProvider">
        /// An injected message type provider instance.
        /// Except for mock testing, this should always be one of
        /// <see cref="OAuthConsumerMessageFactory"/> or <see cref="OAuthServiceProviderMessageFactory"/>.
        /// </param>
        internal OAuthChannel(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, ITokenManager tokenManager, IMessageFactory messageTypeProvider)
            : base(messageTypeProvider, InitializeBindingElements(signingBindingElement, store, tokenManager))
        {
            ErrorUtilities.VerifyArgumentNotNull(tokenManager, "tokenManager");

            this.TokenManager = tokenManager;
            ErrorUtilities.VerifyArgumentNamed(signingBindingElement.SignatureCallback == null, "signingBindingElement", OAuthStrings.SigningElementAlreadyAssociatedWithChannel);

            signingBindingElement.SignatureCallback = this.SignatureCallback;
        }
开发者ID:jcp-xx,项目名称:dotnetopenid,代码行数:21,代码来源:OAuthChannel.cs


示例12: OAuthChannel

		protected OAuthChannel(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, ITokenManager tokenManager, SecuritySettings securitySettings, IMessageFactory messageTypeProvider, IChannelBindingElement[] bindingElements)
			: base(messageTypeProvider, bindingElements) {
			Requires.NotNull(tokenManager, "tokenManager");
			Requires.NotNull(securitySettings, "securitySettings");
			Requires.NotNull(signingBindingElement, "signingBindingElement");
			Requires.True(signingBindingElement.SignatureCallback == null, "signingBindingElement", OAuthStrings.SigningElementAlreadyAssociatedWithChannel);
			Requires.NotNull(bindingElements, "bindingElements");

			this.TokenManager = tokenManager;
			signingBindingElement.SignatureCallback = this.SignatureCallback;
		}
开发者ID:rafek,项目名称:dotnetopenid,代码行数:11,代码来源:OAuthChannel.cs


示例13: OAuthConsumerChannel

		internal OAuthConsumerChannel(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, IConsumerTokenManager tokenManager, ConsumerSecuritySettings securitySettings, IMessageFactory messageFactory = null)
			: base(
			signingBindingElement,
			tokenManager,
			securitySettings,
			messageFactory ?? new OAuthConsumerMessageFactory(),
			InitializeBindingElements(signingBindingElement, store)) {
			Requires.NotNull(tokenManager, "tokenManager");
			Requires.NotNull(securitySettings, "securitySettings");
			Requires.NotNull(signingBindingElement, "signingBindingElement");
		}
开发者ID:brivas,项目名称:DotNetOpenAuth,代码行数:11,代码来源:OAuthConsumerChannel.cs


示例14: InitializeBindingElements

		/// <summary>
		/// Initializes the binding elements for the OAuth channel.
		/// </summary>
		/// <param name="signingBindingElement">The signing binding element.</param>
		/// <param name="store">The nonce store.</param>
		/// <param name="tokenManager">The token manager.</param>
		/// <param name="securitySettings">The security settings.</param>
		/// <returns>
		/// An array of binding elements used to initialize the channel.
		/// </returns>
		private static IChannelBindingElement[] InitializeBindingElements(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, ITokenManager tokenManager, SecuritySettings securitySettings) {
			Requires.NotNull(securitySettings, "securitySettings");

			var bindingElements = OAuthChannel.InitializeBindingElements(signingBindingElement, store);

			var spTokenManager = tokenManager as IServiceProviderTokenManager;
			var serviceProviderSecuritySettings = securitySettings as ServiceProviderSecuritySettings;
			bindingElements.Insert(0, new TokenHandlingBindingElement(spTokenManager, serviceProviderSecuritySettings));

			return bindingElements.ToArray();
		}
开发者ID:substrate9,项目名称:DotNetOpenAuth,代码行数:21,代码来源:OAuthServiceProviderChannel.cs


示例15: ArgumentNullException

        IIdSiteSyncCallbackHandler IIdSiteSyncCallbackHandler.SetNonceStore(INonceStore nonceStore)
        {
            if (nonceStore == null)
            {
                throw new ArgumentNullException(nameof(nonceStore));
            }

            this.nonceStore = nonceStore;

            return this;
        }
开发者ID:ssankar1234,项目名称:stormpath-sdk-dotnet,代码行数:11,代码来源:DefaultIdSiteSyncCallbackHandler.cs


示例16: OAuthServiceProviderChannel

		internal OAuthServiceProviderChannel(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, IServiceProviderTokenManager tokenManager, ServiceProviderSecuritySettings securitySettings, IMessageFactory messageTypeProvider = null)
			: base(
			signingBindingElement,
			tokenManager,
			securitySettings,
			messageTypeProvider ?? new OAuthServiceProviderMessageFactory(tokenManager),
			InitializeBindingElements(signingBindingElement, store, tokenManager, securitySettings)) {
			Requires.NotNull(tokenManager, "tokenManager");
			Requires.NotNull(securitySettings, "securitySettings");
			Requires.NotNull(signingBindingElement, "signingBindingElement");
		}
开发者ID:substrate9,项目名称:DotNetOpenAuth,代码行数:11,代码来源:OAuthServiceProviderChannel.cs


示例17: OAuthChannel

		internal OAuthChannel(ITamperProtectionChannelBindingElement signingBindingElement, INonceStore store, IServiceProviderTokenManager tokenManager, ServiceProviderSecuritySettings securitySettings)
			: this(
			signingBindingElement,
			store,
			tokenManager,
			securitySettings,
			new OAuthServiceProviderMessageFactory(tokenManager)) {
			Contract.Requires<ArgumentNullException>(tokenManager != null);
			Contract.Requires<ArgumentNullException>(securitySettings != null);
			Contract.Requires<ArgumentNullException>(signingBindingElement != null);
			Contract.Requires<ArgumentException>(signingBindingElement.SignatureCallback == null, OAuthStrings.SigningElementAlreadyAssociatedWithChannel);
		}
开发者ID:enslam,项目名称:dotnetopenid,代码行数:12,代码来源:OAuthChannel.cs


示例18: OpenIdProvider

        /// <summary>
        /// Initializes a new instance of the <see cref="OpenIdProvider"/> class.
        /// </summary>
        /// <param name="associationStore">The association store to use.  Cannot be null.</param>
        /// <param name="nonceStore">The nonce store to use.  Cannot be null.</param>
        private OpenIdProvider(IAssociationStore<AssociationRelyingPartyType> associationStore, INonceStore nonceStore)
        {
            Contract.Requires(associationStore != null);
            Contract.Requires(nonceStore != null);
            Contract.Ensures(this.AssociationStore == associationStore);
            Contract.Ensures(this.SecuritySettings != null);
            Contract.Ensures(this.Channel != null);
            ErrorUtilities.VerifyArgumentNotNull(associationStore, "associationStore");
            ErrorUtilities.VerifyArgumentNotNull(nonceStore, "nonceStore");

            this.AssociationStore = associationStore;
            this.SecuritySettings = DotNetOpenAuthSection.Configuration.OpenId.Provider.SecuritySettings.CreateSecuritySettings();
            this.Channel = new OpenIdChannel(this.AssociationStore, nonceStore, this.SecuritySettings);
        }
开发者ID:vrushalid,项目名称:dotnetopenid,代码行数:19,代码来源:OpenIdProvider.cs


示例19: OpenIdProvider

		/// <summary>
		/// Initializes a new instance of the <see cref="OpenIdProvider"/> class.
		/// </summary>
		/// <param name="nonceStore">The nonce store to use.  Cannot be null.</param>
		/// <param name="cryptoKeyStore">The crypto key store.  Cannot be null.</param>
		private OpenIdProvider(INonceStore nonceStore, ICryptoKeyStore cryptoKeyStore) {
			Requires.NotNull(nonceStore, "nonceStore");
			Requires.NotNull(cryptoKeyStore, "cryptoKeyStore");

			this.SecuritySettings = OpenIdElement.Configuration.Provider.SecuritySettings.CreateSecuritySettings();
			this.behaviors.CollectionChanged += this.OnBehaviorsChanged;
			foreach (var behavior in OpenIdElement.Configuration.Provider.Behaviors.CreateInstances(false)) {
				this.behaviors.Add(behavior);
			}

			this.AssociationStore = new SwitchingAssociationStore(cryptoKeyStore, this.SecuritySettings);
			this.Channel = new OpenIdProviderChannel(this.AssociationStore, nonceStore, this.SecuritySettings);
			this.CryptoKeyStore = cryptoKeyStore;
			this.discoveryServices = new IdentifierDiscoveryServices(this);

			Reporting.RecordFeatureAndDependencyUse(this, nonceStore);
		}
开发者ID:substrate9,项目名称:DotNetOpenAuth,代码行数:22,代码来源:OpenIdProvider.cs


示例20: OpenIdProvider

		/// <summary>
		/// Initializes a new instance of the <see cref="OpenIdProvider"/> class.
		/// </summary>
		/// <param name="associationStore">The association store to use.  Cannot be null.</param>
		/// <param name="nonceStore">The nonce store to use.  Cannot be null.</param>
		private OpenIdProvider(IAssociationStore<AssociationRelyingPartyType> associationStore, INonceStore nonceStore) {
			Contract.Requires<ArgumentNullException>(associationStore != null);
			Contract.Requires<ArgumentNullException>(nonceStore != null);
			Contract.Ensures(this.AssociationStore == associationStore);
			Contract.Ensures(this.SecuritySettings != null);
			Contract.Ensures(this.Channel != null);

			this.AssociationStore = associationStore;
			this.SecuritySettings = DotNetOpenAuthSection.Configuration.OpenId.Provider.SecuritySettings.CreateSecuritySettings();
			this.behaviors.CollectionChanged += this.OnBehaviorsChanged;
			foreach (var behavior in DotNetOpenAuthSection.Configuration.OpenId.Provider.Behaviors.CreateInstances(false)) {
				this.behaviors.Add(behavior);
			}

			this.Channel = new OpenIdChannel(this.AssociationStore, nonceStore, this.SecuritySettings);

			Reporting.RecordFeatureAndDependencyUse(this, associationStore, nonceStore);
		}
开发者ID:jsmale,项目名称:dotnetopenid,代码行数:23,代码来源:OpenIdProvider.cs



注:本文中的INonceStore类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# INotification类代码示例发布时间:2022-05-24
下一篇:
C# INodeVisitor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap