Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardProofToken.cs / 1305376 / InfoCardProofToken.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.IdentityModel.Tokens; using System.IdentityModel.Policy; using System.IdentityModel.Claims; using System.Collections.Generic; using System.Collections.ObjectModel; // // Summary: // This class implements a SecurityToken to wrap a remoted crypto key. It provides indirect // access to the private proof key associated with a released token. // internal class InfoCardProofToken : SecurityToken, IDisposable { string m_id; DateTime m_expiration; ReadOnlyCollectionm_securityKeys; SecurityKey m_securityKey; public InfoCardProofToken( AsymmetricCryptoHandle cryptoHandle, DateTime expiration ) : this( expiration ) { InitCrypto( new InfoCardAsymmetricCrypto( cryptoHandle ) ); } public InfoCardProofToken( SymmetricCryptoHandle cryptoHandle, DateTime expiration ) : this( expiration ) { InitCrypto( new InfoCardSymmetricCrypto( cryptoHandle ) ); } private InfoCardProofToken( DateTime expiration ) : base() { m_id = Guid.NewGuid().ToString(); m_expiration = expiration.ToUniversalTime(); } public override string Id { get { return m_id; } } public override ReadOnlyCollection SecurityKeys { get { return m_securityKeys; } } public override DateTime ValidTo { get { return m_expiration; } } public override DateTime ValidFrom { get { return DateTime.UtcNow; } } private void InitCrypto(SecurityKey securityKey) { m_securityKey = securityKey; List securityKeys = new List (1); securityKeys.Add(securityKey); m_securityKeys = securityKeys.AsReadOnly(); } public void Dispose() { m_securityKeys = null; ((IDisposable)m_securityKey).Dispose(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.IdentityModel.Tokens; using System.IdentityModel.Policy; using System.IdentityModel.Claims; using System.Collections.Generic; using System.Collections.ObjectModel; // // Summary: // This class implements a SecurityToken to wrap a remoted crypto key. It provides indirect // access to the private proof key associated with a released token. // internal class InfoCardProofToken : SecurityToken, IDisposable { string m_id; DateTime m_expiration; ReadOnlyCollection m_securityKeys; SecurityKey m_securityKey; public InfoCardProofToken( AsymmetricCryptoHandle cryptoHandle, DateTime expiration ) : this( expiration ) { InitCrypto( new InfoCardAsymmetricCrypto( cryptoHandle ) ); } public InfoCardProofToken( SymmetricCryptoHandle cryptoHandle, DateTime expiration ) : this( expiration ) { InitCrypto( new InfoCardSymmetricCrypto( cryptoHandle ) ); } private InfoCardProofToken( DateTime expiration ) : base() { m_id = Guid.NewGuid().ToString(); m_expiration = expiration.ToUniversalTime(); } public override string Id { get { return m_id; } } public override ReadOnlyCollection SecurityKeys { get { return m_securityKeys; } } public override DateTime ValidTo { get { return m_expiration; } } public override DateTime ValidFrom { get { return DateTime.UtcNow; } } private void InitCrypto(SecurityKey securityKey) { m_securityKey = securityKey; List securityKeys = new List (1); securityKeys.Add(securityKey); m_securityKeys = securityKeys.AsReadOnly(); } public void Dispose() { m_securityKeys = null; ((IDisposable)m_securityKey).Dispose(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlBufferReader.cs
- Brushes.cs
- EqualityComparer.cs
- Privilege.cs
- ExpandoClass.cs
- BuildProvider.cs
- AttachInfo.cs
- BoundingRectTracker.cs
- ThreadStateException.cs
- SQLByte.cs
- DataGridViewRowPostPaintEventArgs.cs
- DataGrid.cs
- CodeGeneratorAttribute.cs
- TopClause.cs
- HMACMD5.cs
- ConcurrentQueue.cs
- StringUtil.cs
- BuildManager.cs
- GB18030Encoding.cs
- Transform.cs
- NativeCompoundFileAPIs.cs
- PropertyRef.cs
- SafeNativeMethodsCLR.cs
- TimelineCollection.cs
- AssertUtility.cs
- DataServiceRequestException.cs
- Wizard.cs
- HeaderedContentControl.cs
- TransformerConfigurationWizardBase.cs
- AffineTransform3D.cs
- PropertyKey.cs
- MenuBase.cs
- SymmetricSecurityProtocol.cs
- WindowPattern.cs
- DataControlFieldHeaderCell.cs
- CodeValidator.cs
- ReadOnlyDataSourceView.cs
- SafeViewOfFileHandle.cs
- WebHeaderCollection.cs
- RawStylusInput.cs
- NotifyParentPropertyAttribute.cs
- HttpModulesSection.cs
- TypeSystem.cs
- RSAOAEPKeyExchangeDeformatter.cs
- SafeLocalMemHandle.cs
- StubHelpers.cs
- PriorityChain.cs
- ReadOnlyDictionary.cs
- XmlDataSourceNodeDescriptor.cs
- SHA1CryptoServiceProvider.cs
- HatchBrush.cs
- PrimitiveType.cs
- FederatedMessageSecurityOverHttp.cs
- DataBindingExpressionBuilder.cs
- TextEndOfSegment.cs
- BlurBitmapEffect.cs
- Int32.cs
- InlineObject.cs
- CreateUserErrorEventArgs.cs
- WebDescriptionAttribute.cs
- TypeResolvingOptions.cs
- TemplateControl.cs
- NetworkInformationException.cs
- EntityDataSourceWrapper.cs
- ScriptHandlerFactory.cs
- InstanceCreationEditor.cs
- SHA384Managed.cs
- ToolboxItemAttribute.cs
- SHA384Managed.cs
- AccessText.cs
- Themes.cs
- PropertyValueUIItem.cs
- BuildManagerHost.cs
- DataBindingValueUIHandler.cs
- EdgeModeValidation.cs
- ExtendedPropertiesHandler.cs
- Atom10FeedFormatter.cs
- FormsAuthenticationTicket.cs
- CompatibleIComparer.cs
- ZipIOCentralDirectoryBlock.cs
- ObjectDataSourceDisposingEventArgs.cs
- ImageDrawing.cs
- XmlSchemaSimpleTypeUnion.cs
- EventDescriptorCollection.cs
- SettingsPropertyValueCollection.cs
- ContractMapping.cs
- EntryIndex.cs
- InputDevice.cs
- BlockCollection.cs
- ProfessionalColorTable.cs
- Application.cs
- EntityDesignerBuildProvider.cs
- TypeNameHelper.cs
- TailCallAnalyzer.cs
- XmlSchemaSimpleTypeList.cs
- RepeatButton.cs
- TemplatedMailWebEventProvider.cs
- XmlDataSource.cs
- WebRequestModulesSection.cs
- DocobjHost.cs