Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / ListDependantCardsRequest.cs / 1 / ListDependantCardsRequest.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Text; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary // Processes a request to find the list of managed cards that use a specific // self issued card for authentication to the IP // // // Specify valid parent requests. // class ListDependantCardsRequest :UIAgentRequest { Uri m_selfIssuedCardId; // Specifies the card identifier. Listm_allCards = new List (); public ListDependantCardsRequest( IntPtr rpcHandle, Stream inArgs, Stream outArgs, ClientUIRequest parent ) : base( rpcHandle, inArgs, outArgs, parent ) { } // // Summary // Marshals input arguments for the request. The arguments are read from a stream in binary. // protected override void OnMarshalInArgs() { BinaryReader reader = new InfoCardBinaryReader( InArgs, Encoding.Unicode ); m_selfIssuedCardId = new Uri( Utility.DeserializeString( reader ) ); } // // Summary // Processes the request. // protected override void OnProcess() { StoreConnection connection = StoreConnection.GetConnection(); try { // // Retrieve all the managed cards that use self issued cards for authentication // // // Get the full list of all infocards. // IList rows = (IList )connection.Query( QueryDetails.FullRow, connection.LocalDataSource, new QueryParameter( SecondaryIndexDefinition.SupportedAuthIndex, (Int32)TokenFactoryCredentialType.SelfIssuedCredential ) ); if( null != rows && 0 != rows.Count ) { for( int i = 0; i < rows.Count; i++ ) { byte[ ] rawForm = rows[ i ].GetDataField(); try { using( MemoryStream stream = new MemoryStream( rawForm ) ) { InfoCard card = new InfoCard( stream ); foreach( TokenCreationParameter param in card.CreationParameters ) { if( param.CredentialType == TokenFactoryCredentialType.SelfIssuedCredential ) { string ppid = param.CredentialSelectors[ CredentialSelectorType.SelfIssuedCardIdSelector ].GetStringWithoutNullTerminator(); if( Utility.CompareByteArrays( Convert.FromBase64String( ppid ), Utility.CreateHash( card.IssuerIdentifierAsBytes, m_selfIssuedCardId ) ) ) { m_allCards.Add( card ); } } } } } finally { Array.Clear( rawForm, 0, rawForm.Length ); } } } } finally { connection.Close(); } } // // Summary // Marshals output arguments for the request. The arguments are written to a stream in binary. // protected override void OnMarshalOutArgs() { Stream stream = OutArgs; BinaryWriter writer = new BinaryWriter( stream, System.Text.Encoding.Unicode ); if( null != m_allCards ) { writer.Write( (Int32)m_allCards.Count); foreach( InfoCard card in m_allCards ) { Utility.SerializeUri( writer, card.Id ); } } else { writer.Write( (Int32)0 ); } } } } // 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
- FreeIndexList.cs
- ListViewAutomationPeer.cs
- PauseStoryboard.cs
- DocumentGridContextMenu.cs
- XmlSchemaChoice.cs
- CacheVirtualItemsEvent.cs
- HostSecurityManager.cs
- XmlSerializer.cs
- XmlComment.cs
- FreezableOperations.cs
- SystemIPInterfaceProperties.cs
- BaseDataListActionList.cs
- UriTemplateTrieLocation.cs
- TextElementCollection.cs
- ClientScriptItem.cs
- UrlMappingsSection.cs
- MissingSatelliteAssemblyException.cs
- StringCollection.cs
- ClientBuildManager.cs
- BaseComponentEditor.cs
- ViewEventArgs.cs
- RepeatBehaviorConverter.cs
- CompiledQueryCacheKey.cs
- DummyDataSource.cs
- GenericAuthenticationEventArgs.cs
- DeadCharTextComposition.cs
- QueryableDataSource.cs
- ISAPIWorkerRequest.cs
- DragEvent.cs
- TextBlockAutomationPeer.cs
- ParameterElementCollection.cs
- OptimizedTemplateContentHelper.cs
- DurableEnlistmentState.cs
- HebrewNumber.cs
- ActivityMetadata.cs
- COM2Enum.cs
- HandleExceptionArgs.cs
- SymmetricKey.cs
- WebPartCatalogCloseVerb.cs
- ApplicationFileParser.cs
- Int64KeyFrameCollection.cs
- UiaCoreTypesApi.cs
- X509AsymmetricSecurityKey.cs
- DynamicUpdateCommand.cs
- TypeProvider.cs
- XPathNode.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- ToolboxComponentsCreatedEventArgs.cs
- RelativeSource.cs
- xdrvalidator.cs
- Query.cs
- CodePrimitiveExpression.cs
- DtdParser.cs
- HttpPostedFileWrapper.cs
- CardSpaceException.cs
- SerializationHelper.cs
- DesignerAdRotatorAdapter.cs
- ClassDataContract.cs
- SimpleWebHandlerParser.cs
- UrlAuthFailedErrorFormatter.cs
- SplineQuaternionKeyFrame.cs
- UserControlCodeDomTreeGenerator.cs
- RoleGroupCollection.cs
- ValueTable.cs
- MenuItemStyleCollection.cs
- Mouse.cs
- WinHttpWebProxyFinder.cs
- InvalidPipelineStoreException.cs
- DispatcherEventArgs.cs
- EllipseGeometry.cs
- OuterGlowBitmapEffect.cs
- EqualityComparer.cs
- EventMappingSettings.cs
- AttachInfo.cs
- PasswordPropertyTextAttribute.cs
- XmlSecureResolver.cs
- SchemaNotation.cs
- WebPartConnectionsConfigureVerb.cs
- HandledEventArgs.cs
- LongMinMaxAggregationOperator.cs
- CompatibleIComparer.cs
- GrammarBuilderWildcard.cs
- mediaclock.cs
- Rotation3DAnimationBase.cs
- CombinedGeometry.cs
- ClrProviderManifest.cs
- EntityContainerEmitter.cs
- XmlName.cs
- BaseTreeIterator.cs
- SizeChangedEventArgs.cs
- LiteralControl.cs
- ByteAnimationUsingKeyFrames.cs
- ScriptRegistrationManager.cs
- RegexRunnerFactory.cs
- ExtensibleClassFactory.cs
- SingleSelectRootGridEntry.cs
- ConfigXmlText.cs
- DictionaryManager.cs
- _FixedSizeReader.cs
- elementinformation.cs