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
- ContextMenuStrip.cs
- Overlapped.cs
- TemplateField.cs
- InvokePattern.cs
- IOException.cs
- AutomationIdentifierGuids.cs
- EntityParameterCollection.cs
- InvokePatternIdentifiers.cs
- XmlNodeReader.cs
- InheritanceContextHelper.cs
- CompilationLock.cs
- DiscoveryReference.cs
- ObjectComplexPropertyMapping.cs
- RenameRuleObjectDialog.cs
- XmlAttribute.cs
- TabControl.cs
- ToolBarOverflowPanel.cs
- HostSecurityManager.cs
- DataControlPagerLinkButton.cs
- DiscreteKeyFrames.cs
- EmptyStringExpandableObjectConverter.cs
- TextBox.cs
- AttributeSetAction.cs
- SmtpReplyReader.cs
- GeneralTransformGroup.cs
- CodeGeneratorOptions.cs
- MSHTMLHost.cs
- EnumValAlphaComparer.cs
- UnsafeNativeMethods.cs
- HitTestParameters.cs
- CqlQuery.cs
- DataGridViewLinkColumn.cs
- ByteStream.cs
- SerializationEventsCache.cs
- FamilyMapCollection.cs
- CellIdBoolean.cs
- LOSFormatter.cs
- XamlHostingConfiguration.cs
- MemoryStream.cs
- ColorDialog.cs
- SkipQueryOptionExpression.cs
- SafeFindHandle.cs
- XsdSchemaFileEditor.cs
- ConfigurationValues.cs
- ContourSegment.cs
- HttpProxyCredentialType.cs
- HttpVersion.cs
- ServerIdentity.cs
- WindowsNonControl.cs
- ToolBar.cs
- ConfigurationCollectionAttribute.cs
- ActivationServices.cs
- ListControlBoundActionList.cs
- BamlLocalizabilityResolver.cs
- ColumnHeaderConverter.cs
- SignatureHelper.cs
- WhereQueryOperator.cs
- AssemblyInfo.cs
- FolderLevelBuildProviderCollection.cs
- GradientBrush.cs
- EventWaitHandleSecurity.cs
- FamilyMap.cs
- DataServiceBehavior.cs
- HyperLinkStyle.cs
- ContextDataSourceContextData.cs
- SoapReflectionImporter.cs
- JavascriptCallbackResponseProperty.cs
- Binding.cs
- RoleService.cs
- InstanceKeyNotReadyException.cs
- PenThreadPool.cs
- RecordConverter.cs
- SmiEventSink_Default.cs
- BaseDataList.cs
- VerbConverter.cs
- XmlAttributeHolder.cs
- assertwrapper.cs
- ObjectSet.cs
- UTF7Encoding.cs
- BackStopAuthenticationModule.cs
- MobileCategoryAttribute.cs
- CommonProperties.cs
- WebPartDisplayModeCollection.cs
- BaseTreeIterator.cs
- CompletedAsyncResult.cs
- SafeHandle.cs
- DeploymentExceptionMapper.cs
- Point3D.cs
- ToolZone.cs
- AsyncDataRequest.cs
- ITextView.cs
- invalidudtexception.cs
- TypeSystemProvider.cs
- DependencyPropertyChangedEventArgs.cs
- CodeObjectCreateExpression.cs
- XmlObjectSerializerReadContextComplex.cs
- WebEvents.cs
- ComponentChangingEvent.cs
- MemberAccessException.cs
- contentDescriptor.cs