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
- WebPartConnectionsEventArgs.cs
- UIServiceHelper.cs
- CompareValidator.cs
- CollectionType.cs
- QuaternionAnimation.cs
- QilPatternVisitor.cs
- SiteIdentityPermission.cs
- UnsettableComboBox.cs
- RelatedPropertyManager.cs
- DataListItemCollection.cs
- SafeViewOfFileHandle.cs
- StreamSecurityUpgradeAcceptorBase.cs
- ConsumerConnectionPointCollection.cs
- ValidatingReaderNodeData.cs
- ProxyWebPart.cs
- BamlMapTable.cs
- Peer.cs
- ProfileEventArgs.cs
- SnapLine.cs
- ItemCollection.cs
- ColumnWidthChangedEvent.cs
- ConcurrentStack.cs
- ColorAnimationBase.cs
- ExpressionVisitor.cs
- AdRotator.cs
- CmsInterop.cs
- XXXOnTypeBuilderInstantiation.cs
- Group.cs
- InternalPermissions.cs
- FrameworkTextComposition.cs
- DataGridViewRow.cs
- PeerNodeAddress.cs
- WriterOutput.cs
- HttpModuleActionCollection.cs
- NotifyCollectionChangedEventArgs.cs
- BinarySerializer.cs
- DataColumnMappingCollection.cs
- GeometryDrawing.cs
- FileStream.cs
- StatusBarPanelClickEvent.cs
- DispatcherEventArgs.cs
- TraceLevelStore.cs
- BinaryWriter.cs
- AdCreatedEventArgs.cs
- FixedSOMPageElement.cs
- PasswordTextContainer.cs
- InternalConfigRoot.cs
- EventMappingSettings.cs
- FloaterBaseParagraph.cs
- wmiprovider.cs
- WizardSideBarListControlItemEventArgs.cs
- ErrorReporting.cs
- XmlUtil.cs
- BindingOperations.cs
- Automation.cs
- ColorMatrix.cs
- ChangesetResponse.cs
- ResourceManager.cs
- EventKeyword.cs
- XpsImage.cs
- _ContextAwareResult.cs
- ChildTable.cs
- HttpListener.cs
- MethodBuilderInstantiation.cs
- TableCellCollection.cs
- SecurityAccessDeniedException.cs
- ColumnMapVisitor.cs
- LineSegment.cs
- XamlClipboardData.cs
- PassportAuthenticationEventArgs.cs
- ObjectStateEntry.cs
- SqlConnectionStringBuilder.cs
- MimeReturn.cs
- MenuAutomationPeer.cs
- SmtpFailedRecipientsException.cs
- XamlPointCollectionSerializer.cs
- IODescriptionAttribute.cs
- HitTestParameters3D.cs
- DoubleConverter.cs
- XmlWellformedWriterHelpers.cs
- RowUpdatedEventArgs.cs
- XmlKeywords.cs
- SecurityRuntime.cs
- userdatakeys.cs
- BufferedReceiveManager.cs
- QuadraticBezierSegment.cs
- ChooseAction.cs
- TableAutomationPeer.cs
- TokenBasedSetEnumerator.cs
- RadioButton.cs
- Buffer.cs
- SymbolEqualComparer.cs
- RewritingSimplifier.cs
- XmlSchemaAppInfo.cs
- DataMember.cs
- SoapFault.cs
- BamlReader.cs
- WebPartEditorApplyVerb.cs
- SqlDataSource.cs
- InvokeProviderWrapper.cs