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
- PassportPrincipal.cs
- DispatcherSynchronizationContext.cs
- DocumentEventArgs.cs
- MSAAWinEventWrap.cs
- Debug.cs
- XPathSelectionIterator.cs
- ConnectionStringsExpressionEditor.cs
- BindingList.cs
- EventLogEntry.cs
- CharAnimationUsingKeyFrames.cs
- ContainerUtilities.cs
- DataControlField.cs
- EntityDataSourceStatementEditor.cs
- contentDescriptor.cs
- AppSettingsExpressionBuilder.cs
- SqlCacheDependencyDatabase.cs
- BlockUIContainer.cs
- CompilerLocalReference.cs
- NameTable.cs
- Certificate.cs
- ConstraintManager.cs
- WebPartConnectionsConnectVerb.cs
- TripleDESCryptoServiceProvider.cs
- SQLDouble.cs
- MatrixTransform3D.cs
- HyperLinkColumn.cs
- GroupedContextMenuStrip.cs
- WsatStrings.cs
- XmlCharType.cs
- XmlSchemaSubstitutionGroup.cs
- EventLogPermissionAttribute.cs
- PropertyNames.cs
- __Filters.cs
- SoapObjectWriter.cs
- PropertyPathWorker.cs
- AttributeEmitter.cs
- InvalidComObjectException.cs
- XmlSchemaChoice.cs
- storepermission.cs
- securitymgrsite.cs
- TimeSpanSecondsConverter.cs
- ClientScriptItemCollection.cs
- DocumentOrderQuery.cs
- EventHandlersStore.cs
- Constraint.cs
- IpcClientChannel.cs
- WebServicesInteroperability.cs
- Int16Converter.cs
- DbDeleteCommandTree.cs
- SupportsEventValidationAttribute.cs
- DateTimeOffsetAdapter.cs
- Touch.cs
- Content.cs
- DataListComponentEditor.cs
- MultipleViewPattern.cs
- GroupItemAutomationPeer.cs
- HttpProcessUtility.cs
- WindowsAuthenticationModule.cs
- EntityViewGenerator.cs
- ExpandSegment.cs
- MessageLoggingFilterTraceRecord.cs
- HashHelper.cs
- Section.cs
- MemberHolder.cs
- XmlNodeWriter.cs
- Int32Collection.cs
- SoapIncludeAttribute.cs
- SQlBooleanStorage.cs
- VideoDrawing.cs
- FunctionDetailsReader.cs
- EdgeProfileValidation.cs
- QilScopedVisitor.cs
- RenderContext.cs
- ProcessHostConfigUtils.cs
- DbProviderFactories.cs
- Error.cs
- VBIdentifierDesigner.xaml.cs
- sqlser.cs
- BlobPersonalizationState.cs
- WebHeaderCollection.cs
- OrderedDictionary.cs
- GridProviderWrapper.cs
- SqlTriggerContext.cs
- GenericEnumConverter.cs
- HasCopySemanticsAttribute.cs
- ClientConfigurationSystem.cs
- XPathNodeIterator.cs
- DataGridViewHeaderCell.cs
- XmlIgnoreAttribute.cs
- DbDataSourceEnumerator.cs
- FollowerQueueCreator.cs
- ImageInfo.cs
- DesignerGeometryHelper.cs
- ControlBuilderAttribute.cs
- HttpEncoder.cs
- EncryptedKey.cs
- SystemIcmpV4Statistics.cs
- BindingValueChangedEventArgs.cs
- QilGenerator.cs
- FixedSOMPageElement.cs