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
- ProfileService.cs
- FontStretch.cs
- XmlSchemaImport.cs
- DataSetUtil.cs
- FigureParagraph.cs
- InputLanguageManager.cs
- GeneralTransform3DTo2DTo3D.cs
- WebPartsSection.cs
- SqlMethodTransformer.cs
- _CacheStreams.cs
- TypeSystem.cs
- Selector.cs
- PrimaryKeyTypeConverter.cs
- StylusButton.cs
- BasicViewGenerator.cs
- CornerRadiusConverter.cs
- VariableDesigner.xaml.cs
- DispatchChannelSink.cs
- PanelDesigner.cs
- TableLayoutSettings.cs
- QueryRewriter.cs
- ReferentialConstraint.cs
- RowBinding.cs
- NetDataContractSerializer.cs
- Rules.cs
- RecognizedWordUnit.cs
- MsmqIntegrationBindingElement.cs
- ExtensionFile.cs
- MatrixKeyFrameCollection.cs
- SoapFault.cs
- CheckBox.cs
- FunctionCommandText.cs
- XhtmlTextWriter.cs
- CheckedPointers.cs
- XPathBuilder.cs
- SelectionHighlightInfo.cs
- ColumnHeader.cs
- Msmq4PoisonHandler.cs
- MachineSettingsSection.cs
- RayHitTestParameters.cs
- QueryMath.cs
- MetadataSerializer.cs
- MarginsConverter.cs
- AvTraceFormat.cs
- Zone.cs
- Content.cs
- SingleQueryOperator.cs
- SafeMemoryMappedViewHandle.cs
- NotCondition.cs
- RichTextBoxDesigner.cs
- SoapFault.cs
- WmpBitmapEncoder.cs
- OdbcCommandBuilder.cs
- mongolianshape.cs
- UpdateException.cs
- SpeechSeg.cs
- SHA1Managed.cs
- ClientEndpointLoader.cs
- PathData.cs
- XmlSerializerSection.cs
- CodeGen.cs
- _AcceptOverlappedAsyncResult.cs
- CoTaskMemUnicodeSafeHandle.cs
- PartBasedPackageProperties.cs
- TypeToken.cs
- RowVisual.cs
- GroupQuery.cs
- LeaseManager.cs
- ProcessModelSection.cs
- infer.cs
- SerializationInfo.cs
- ReceiveContext.cs
- Canvas.cs
- EntityContainerAssociationSetEnd.cs
- IntSecurity.cs
- DifferencingCollection.cs
- StringToken.cs
- PeerEndPoint.cs
- PartBasedPackageProperties.cs
- FormViewDeletedEventArgs.cs
- Frame.cs
- NotFiniteNumberException.cs
- FilteredXmlReader.cs
- DiscardableAttribute.cs
- SortedDictionary.cs
- ReflectionUtil.cs
- InfoCardClaimCollection.cs
- ElementNotAvailableException.cs
- DynamicResourceExtensionConverter.cs
- SchemaInfo.cs
- CodeStatement.cs
- FilterException.cs
- FrameDimension.cs
- TrustLevel.cs
- ServiceDefaults.cs
- Context.cs
- basenumberconverter.cs
- ResourceReferenceExpression.cs
- ProfileSettingsCollection.cs
- NextPreviousPagerField.cs