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
- SqlDataSourceEnumerator.cs
- RuntimeHelpers.cs
- DeferrableContentConverter.cs
- XmlElementAttribute.cs
- validationstate.cs
- FloaterParagraph.cs
- XmlSchemaAttributeGroup.cs
- BuiltInExpr.cs
- XmlDataSourceView.cs
- XPathAxisIterator.cs
- EntityDataSourceContextDisposingEventArgs.cs
- OdbcEnvironmentHandle.cs
- BindingOperations.cs
- Site.cs
- CallbackValidator.cs
- Win32KeyboardDevice.cs
- AudioDeviceOut.cs
- WebPartConnectionsDisconnectVerb.cs
- followingquery.cs
- ComboBoxAutomationPeer.cs
- SerializationAttributes.cs
- WebPartMinimizeVerb.cs
- UserInitiatedNavigationPermission.cs
- RangeBaseAutomationPeer.cs
- PolyBezierSegment.cs
- DataControlLinkButton.cs
- ObjectSecurity.cs
- ReachPrintTicketSerializerAsync.cs
- DataGridItemCollection.cs
- XmlIlVisitor.cs
- SessionSymmetricMessageSecurityProtocolFactory.cs
- AnnotationComponentManager.cs
- OutputScope.cs
- CharEnumerator.cs
- MouseButtonEventArgs.cs
- DataGridViewCellPaintingEventArgs.cs
- ScriptResourceHandler.cs
- CellRelation.cs
- SymbolEqualComparer.cs
- HierarchicalDataBoundControl.cs
- SimpleApplicationHost.cs
- GridEntry.cs
- JavaScriptString.cs
- DataTrigger.cs
- CollectionDataContractAttribute.cs
- CollectionViewGroup.cs
- RefExpr.cs
- Wizard.cs
- GeneralTransform.cs
- EntityDataSourceChangedEventArgs.cs
- AssertFilter.cs
- XmlDownloadManager.cs
- TargetException.cs
- Switch.cs
- IncrementalCompileAnalyzer.cs
- HTMLTextWriter.cs
- PanelStyle.cs
- ThrowOnMultipleAssignment.cs
- oledbmetadatacollectionnames.cs
- Message.cs
- TextAdaptor.cs
- ImageSource.cs
- FileInfo.cs
- WebPartConnectionsCloseVerb.cs
- PositiveTimeSpanValidatorAttribute.cs
- PropertyDescriptorGridEntry.cs
- CodeIterationStatement.cs
- EmptyReadOnlyDictionaryInternal.cs
- SamlAuthorizationDecisionClaimResource.cs
- CatalogPart.cs
- SafeBitVector32.cs
- ObjectDataSourceView.cs
- WebPartManagerInternals.cs
- SqlDataSourceDesigner.cs
- RootProfilePropertySettingsCollection.cs
- EncoderParameter.cs
- StreamResourceInfo.cs
- FileSystemInfo.cs
- ExpressionEditorAttribute.cs
- MediaContextNotificationWindow.cs
- AccessDataSource.cs
- StringFreezingAttribute.cs
- AsyncPostBackErrorEventArgs.cs
- GridViewSortEventArgs.cs
- externdll.cs
- SQLString.cs
- PackageRelationship.cs
- BulletChrome.cs
- CodeBinaryOperatorExpression.cs
- TreeNode.cs
- Section.cs
- QilLiteral.cs
- TextServicesManager.cs
- IsolatedStorageFileStream.cs
- TrustLevelCollection.cs
- WindowsStatic.cs
- Light.cs
- SystemInformation.cs
- COM2ICategorizePropertiesHandler.cs
- FontConverter.cs