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
- EdmError.cs
- LocatorBase.cs
- ManipulationInertiaStartingEventArgs.cs
- controlskin.cs
- LineGeometry.cs
- InputGestureCollection.cs
- DesignerTextViewAdapter.cs
- exports.cs
- ToolStripSystemRenderer.cs
- SqlClientFactory.cs
- XmlSubtreeReader.cs
- PreviewPageInfo.cs
- QueuePropertyVariants.cs
- HandlerMappingMemo.cs
- FontInfo.cs
- MimeTypePropertyAttribute.cs
- BorderGapMaskConverter.cs
- DataGrid.cs
- DirtyTextRange.cs
- ColumnMapVisitor.cs
- HttpHandlersInstallComponent.cs
- ToolStripTextBox.cs
- GestureRecognizer.cs
- StylusCollection.cs
- recordstatescratchpad.cs
- TabRenderer.cs
- wmiprovider.cs
- XamlTemplateSerializer.cs
- GeometryCollection.cs
- HttpConfigurationContext.cs
- DynamicContractTypeBuilder.cs
- InkCollectionBehavior.cs
- TextParagraphView.cs
- ComAdminInterfaces.cs
- PasswordTextNavigator.cs
- CapabilitiesPattern.cs
- GenericPrincipal.cs
- PropertyMetadata.cs
- BitmapEffectRenderDataResource.cs
- VirtualPath.cs
- TreeNodeBindingCollection.cs
- IndentedWriter.cs
- InkCanvasSelectionAdorner.cs
- SoapIgnoreAttribute.cs
- ValidationRuleCollection.cs
- SID.cs
- Visitors.cs
- Material.cs
- WindowsGraphics2.cs
- XmlSchemaAppInfo.cs
- X509RecipientCertificateServiceElement.cs
- MetadataArtifactLoaderResource.cs
- VirtualPathUtility.cs
- RawStylusInputCustomDataList.cs
- MessageVersion.cs
- GeometryDrawing.cs
- ScriptControlDescriptor.cs
- OleDbRowUpdatedEvent.cs
- StreamingContext.cs
- Accessible.cs
- MetaModel.cs
- ProfileSection.cs
- PropagatorResult.cs
- Group.cs
- URLString.cs
- SecurityDescriptor.cs
- DictionaryTraceRecord.cs
- RowUpdatedEventArgs.cs
- CatalogPartChrome.cs
- TextBoxLine.cs
- WebPartConnectionsCancelVerb.cs
- OdbcHandle.cs
- WhitespaceSignificantCollectionAttribute.cs
- WindowsListViewItemStartMenu.cs
- DaylightTime.cs
- storepermissionattribute.cs
- RepeatButtonAutomationPeer.cs
- EntitySqlException.cs
- GroupedContextMenuStrip.cs
- EncryptedType.cs
- EntityContainerEntitySet.cs
- ToolStripProgressBar.cs
- TypedElement.cs
- NullableBoolConverter.cs
- MulticastIPAddressInformationCollection.cs
- SurrogateEncoder.cs
- Validator.cs
- WizardPanel.cs
- IssuedTokenClientElement.cs
- MetadataCacheItem.cs
- ScrollChrome.cs
- DataChangedEventManager.cs
- StrokeCollection.cs
- RelationshipType.cs
- BufferedStream.cs
- WebPageTraceListener.cs
- SymLanguageType.cs
- HtmlInputFile.cs
- ObjectStateFormatter.cs
- TabControlToolboxItem.cs