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
- ProviderConnectionPointCollection.cs
- BrowserCapabilitiesFactory.cs
- ADMembershipProvider.cs
- SignedXml.cs
- ColumnBinding.cs
- FormViewPageEventArgs.cs
- RemoteWebConfigurationHostStream.cs
- SqlExpander.cs
- SqlTrackingQuery.cs
- BezierSegment.cs
- HtmlShim.cs
- ReachUIElementCollectionSerializer.cs
- WizardStepBase.cs
- PersonalizableTypeEntry.cs
- IpcChannelHelper.cs
- ToolStripContainer.cs
- datacache.cs
- SessionStateModule.cs
- XmlSequenceWriter.cs
- TcpClientChannel.cs
- LookupBindingPropertiesAttribute.cs
- OdbcConnectionHandle.cs
- DataTableMappingCollection.cs
- precedingquery.cs
- FrugalMap.cs
- XPathScanner.cs
- SendMailErrorEventArgs.cs
- InputScope.cs
- DiscriminatorMap.cs
- ClientSettingsProvider.cs
- JsonReaderWriterFactory.cs
- DbSource.cs
- FixedHyperLink.cs
- CodeIdentifier.cs
- ToolBarOverflowPanel.cs
- safemediahandle.cs
- LongValidator.cs
- HitTestFilterBehavior.cs
- ImmutableObjectAttribute.cs
- ConnectionsZoneAutoFormat.cs
- Canvas.cs
- Triplet.cs
- KeyGestureConverter.cs
- QilNode.cs
- validationstate.cs
- WebUtil.cs
- DataGridViewCellPaintingEventArgs.cs
- ScrollPatternIdentifiers.cs
- _NetRes.cs
- DataExchangeServiceBinder.cs
- Pointer.cs
- JoinTreeNode.cs
- ConfigDefinitionUpdates.cs
- TaiwanCalendar.cs
- ScrollData.cs
- SymmetricCryptoHandle.cs
- VerificationAttribute.cs
- DefaultShape.cs
- StreamSecurityUpgradeProvider.cs
- CultureMapper.cs
- WebPartConnectionsDisconnectVerb.cs
- EnumType.cs
- HttpDebugHandler.cs
- BitmapMetadataEnumerator.cs
- sqlstateclientmanager.cs
- WeakReadOnlyCollection.cs
- ToolStripDesignerAvailabilityAttribute.cs
- ElementMarkupObject.cs
- HttpListener.cs
- WebRequestModuleElementCollection.cs
- autovalidator.cs
- StatusBar.cs
- CodeArgumentReferenceExpression.cs
- StylusButton.cs
- ContainerFilterService.cs
- SchemaMapping.cs
- GridViewHeaderRowPresenter.cs
- RequiredAttributeAttribute.cs
- DependencyPropertyConverter.cs
- ContractNamespaceAttribute.cs
- AnnotationResourceChangedEventArgs.cs
- PublishLicense.cs
- assertwrapper.cs
- WsatServiceCertificate.cs
- LinkConverter.cs
- DesignerDataParameter.cs
- SQLStringStorage.cs
- IdentifierService.cs
- ConfigPathUtility.cs
- CaseCqlBlock.cs
- XmlException.cs
- _ConnectOverlappedAsyncResult.cs
- BaseHashHelper.cs
- RuleConditionDialog.cs
- DataGridViewCellStyleEditor.cs
- GenericIdentity.cs
- ISAPIApplicationHost.cs
- SortedList.cs
- SchemaReference.cs
- OleDbMetaDataFactory.cs