Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SharingService.cs
- OutputCacheProfile.cs
- SoapElementAttribute.cs
- ContractsBCL.cs
- TransformCryptoHandle.cs
- UpdateTracker.cs
- WebPartManager.cs
- Interop.cs
- EventLogPermissionAttribute.cs
- WindowsPen.cs
- SpecularMaterial.cs
- SystemIPv4InterfaceProperties.cs
- FixedStringLookup.cs
- StateDesigner.Layouts.cs
- WindowsPrincipal.cs
- WindowsHyperlink.cs
- DragSelectionMessageFilter.cs
- Style.cs
- PolyQuadraticBezierSegment.cs
- StrokeFIndices.cs
- CompiledRegexRunner.cs
- WmlPanelAdapter.cs
- MatrixKeyFrameCollection.cs
- GZipStream.cs
- _TimerThread.cs
- XpsFilter.cs
- VisualTreeUtils.cs
- EntityWithChangeTrackerStrategy.cs
- IChannel.cs
- BaseValidator.cs
- SchemaDeclBase.cs
- PolyLineSegment.cs
- MeasurementDCInfo.cs
- SortFieldComparer.cs
- ObjectDataSourceMethodEventArgs.cs
- InfoCardHelper.cs
- RootBrowserWindowProxy.cs
- ImageMapEventArgs.cs
- BinaryFormatterWriter.cs
- TracingConnectionListener.cs
- DecoderBestFitFallback.cs
- CompletionBookmark.cs
- NamespaceCollection.cs
- BitmapCache.cs
- ExpandSegmentCollection.cs
- Decorator.cs
- ImageAutomationPeer.cs
- HitTestParameters.cs
- StandardBindingCollectionElement.cs
- SqlBuilder.cs
- Visual.cs
- InfiniteTimeSpanConverter.cs
- ClientProxyGenerator.cs
- CanonicalizationDriver.cs
- ControlPropertyNameConverter.cs
- EventEntry.cs
- ModelFunctionTypeElement.cs
- ContainsSearchOperator.cs
- DependencyPropertyKey.cs
- LinkArea.cs
- _Win32.cs
- UnmanagedMemoryStreamWrapper.cs
- ToolTipAutomationPeer.cs
- Propagator.ExtentPlaceholderCreator.cs
- BooleanExpr.cs
- ConnectionStringsExpressionBuilder.cs
- ToolStripItemClickedEventArgs.cs
- BitmapCodecInfo.cs
- ImageSource.cs
- WebPartDisplayMode.cs
- ProfilePropertyMetadata.cs
- PublishLicense.cs
- SqlDependencyListener.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- CodeDOMProvider.cs
- TaiwanCalendar.cs
- FastEncoderStatics.cs
- WebPartEditorCancelVerb.cs
- UpDownBase.cs
- SamlConstants.cs
- Control.cs
- PrimarySelectionGlyph.cs
- SafeBitVector32.cs
- FullTextLine.cs
- _SslState.cs
- HScrollBar.cs
- ScriptRegistrationManager.cs
- CollectionViewSource.cs
- CircleEase.cs
- OSFeature.cs
- RecognizerBase.cs
- MediaEntryAttribute.cs
- SerializationException.cs
- Subset.cs
- PenContexts.cs
- OutputCacheSettings.cs
- COM2ComponentEditor.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- XmlCharType.cs
- WebPartEditorCancelVerb.cs