Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / RemoteCryptoTokenProvider.cs / 1 / RemoteCryptoTokenProvider.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.Security.Cryptography.X509Certificates; using System.IdentityModel.Tokens; using System.IdentityModel.Selectors; using System.ServiceModel; using System.ServiceModel.Security; using System.ServiceModel.Security.Tokens; using IDT=Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // Creates a token with remotely hosted keys. // sealed class RemoteCryptoTokenProvider : SecurityTokenProvider, IDisposable { RemoteX509Token m_token; X509Certificate2 m_certificate; object m_sync; public RemoteCryptoTokenProvider( X509Certificate2 cert ) { m_sync = new object(); m_certificate = cert; } public void Dispose() { // // We must dispose this handle explicitly. // IDisposable disposable = m_token as IDisposable; if( null != disposable ) { disposable.Dispose(); m_token = null; } } // // Summary: // Returns the SecurityToken generated. // // Arguments: // timeout: the timeout remaing // protected override SecurityToken GetTokenCore(TimeSpan timeout) { return InnerGetToken(); } // // Summary: // Syncronized get the current token // X509SecurityToken InnerGetToken() { if( null == m_token ) { lock( m_sync ) { if( null == m_token ) { m_token = new RemoteX509Token( m_certificate ); } } } return m_token; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SoundPlayer.cs
- XmlUnspecifiedAttribute.cs
- HybridDictionary.cs
- ResourceExpressionEditorSheet.cs
- AcceleratedTokenProviderState.cs
- BidOverLoads.cs
- OutputCacheSettingsSection.cs
- XmlDocumentSurrogate.cs
- DocumentsTrace.cs
- BuilderPropertyEntry.cs
- ListViewItemEventArgs.cs
- DocumentViewerBaseAutomationPeer.cs
- ParallelTimeline.cs
- QilBinary.cs
- UpdateDelegates.Generated.cs
- SequenceDesignerAccessibleObject.cs
- GlobalEventManager.cs
- MLangCodePageEncoding.cs
- LoginCancelEventArgs.cs
- DropDownList.cs
- TransformedBitmap.cs
- DependencyObjectProvider.cs
- WebExceptionStatus.cs
- StateMachineWorkflow.cs
- FocusTracker.cs
- DataGridViewElement.cs
- ToolStripDropDownDesigner.cs
- ErrorStyle.cs
- ScriptResourceAttribute.cs
- JsonGlobals.cs
- CodeIdentifiers.cs
- LinqDataSourceInsertEventArgs.cs
- x509utils.cs
- Header.cs
- FusionWrap.cs
- SocketPermission.cs
- KeyValueConfigurationElement.cs
- DBCommand.cs
- JsonEncodingStreamWrapper.cs
- DifferencingCollection.cs
- Timer.cs
- GuidelineCollection.cs
- SessionStateItemCollection.cs
- CreateUserWizardStep.cs
- ErrorTableItemStyle.cs
- IisTraceWebEventProvider.cs
- RoutingEndpointTrait.cs
- ObjectIDGenerator.cs
- MessageVersion.cs
- SqlBuilder.cs
- COM2Enum.cs
- ConfigurationValue.cs
- CancelEventArgs.cs
- FixedSOMTableRow.cs
- ChangeConflicts.cs
- SetStateDesigner.cs
- MessageEncodingBindingElement.cs
- HighlightComponent.cs
- BindingUtils.cs
- DataGridTableCollection.cs
- HttpGetServerProtocol.cs
- FileRecordSequenceCompletedAsyncResult.cs
- Vertex.cs
- WebPartEditorOkVerb.cs
- ParameterElement.cs
- TableItemStyle.cs
- ValidationHelper.cs
- GregorianCalendar.cs
- StateMachineAction.cs
- _StreamFramer.cs
- TabletCollection.cs
- DurableErrorHandler.cs
- DataGridViewCellCollection.cs
- VirtualPathUtility.cs
- WorkflowServiceInstance.cs
- Peer.cs
- CustomErrorsSection.cs
- DataGridViewRowStateChangedEventArgs.cs
- WrappedIUnknown.cs
- FontFamily.cs
- SafeHandles.cs
- TextUtf8RawTextWriter.cs
- XmlSchemaGroup.cs
- Component.cs
- WindowsTokenRoleProvider.cs
- TextEditorTables.cs
- CryptoConfig.cs
- DoubleConverter.cs
- HtmlForm.cs
- UrlAuthorizationModule.cs
- PropertyChangingEventArgs.cs
- IdentityModelDictionary.cs
- CookieHandler.cs
- ProfilePropertySettingsCollection.cs
- SBCSCodePageEncoding.cs
- DriveInfo.cs
- Mutex.cs
- EditorZone.cs
- DesignTimeResourceProviderFactoryAttribute.cs
- TempFiles.cs