Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / TokenFactoryCredential.cs / 1 / TokenFactoryCredential.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.Collections.Generic; using System.IO; using System.Security.Cryptography; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; internal enum TokenFactoryCredentialType { Invalid = 0, LocalCredential = -1, UserNamePasswordCredential = 1, SelfIssuedCredential = 2, X509CertificateCredential = 3, KerberosCredential = 4, } // // Summary: // Class to managed and protect credentials collected for access // to token factories. // abstract internal class TokenFactoryCredential : IDisposable { public const int NoCredential = (int)TokenFactoryCredentialType.LocalCredential; TokenFactoryCredentialType m_type; Uri m_cardId; int m_paramIndex; int m_lcid; // // Summary: // Creates an emtpy credential. // protected TokenFactoryCredential( TokenFactoryCredentialType type ) { m_type = type; } public void Dispose() { Dispose( true ); } public virtual void Dispose( bool disposing ) { } // // Summary: // Create a new instance of a TokenFactoryCredential using the specified reader. // public static TokenFactoryCredential CreateFrom( BinaryReader reader, UIAgentRequest request, int lcid ) { TokenFactoryCredential cred; TokenFactoryCredentialType type = (TokenFactoryCredentialType)reader.ReadInt32(); switch( type ) { case TokenFactoryCredentialType.LocalCredential: cred = null; break; case TokenFactoryCredentialType.UserNamePasswordCredential: cred = new UserNameTokenFactoryCredential( ); cred.Deserialize( reader ); break; case TokenFactoryCredentialType.SelfIssuedCredential: cred = new SelfIssuedTokenFactoryCredential( ); cred.Deserialize( reader ); break; case TokenFactoryCredentialType.X509CertificateCredential: cred = new X509CertificateTokenFactoryCredential( request ); cred.Deserialize( reader ); break; case TokenFactoryCredentialType.KerberosCredential: cred = new KerberosTokenFactoryCredential( ); cred.Deserialize( reader ); break; default: IDT.ThrowInvalidArgumentConditional( true, "CredentialType" ); cred = null; break; } if( null != cred ) { cred.LCID = lcid; } return cred; } // // Gets the type of credentials // public int ParameterIndex { get{ return m_paramIndex; } } // // Gets the marshaled TokenFactoryCredentialType value // public TokenFactoryCredentialType CredentialType { get{ return m_type; } } // // LCID for the language that the display token should be in // public int LCID { get { return m_lcid; } set { m_lcid = value; } } // // Get the cardid of the selected card. // public Uri CardId { get{ return m_cardId; } } // // Summary: // Populates the class data from binary form // // Arguments: // reader: The reader that contains the data to populate the class // private void Deserialize( BinaryReader reader ) { // // Byte this point, we have already read the type info, so we skip it here. // m_cardId = new Uri( Utility.DeserializeString( reader ) ); m_paramIndex = reader.ReadInt32(); DeserializeData( reader ); } protected abstract void DeserializeData( BinaryReader reader ); } } // 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
- MailSettingsSection.cs
- BasePropertyDescriptor.cs
- DataGridLengthConverter.cs
- GregorianCalendarHelper.cs
- KeyedHashAlgorithm.cs
- HuffmanTree.cs
- iisPickupDirectory.cs
- ClaimSet.cs
- ControlParameter.cs
- TableRowCollection.cs
- SuppressMessageAttribute.cs
- SvcFileManager.cs
- ModelUIElement3D.cs
- WmiInstallComponent.cs
- UrlMappingCollection.cs
- DbExpressionVisitor_TResultType.cs
- FeatureSupport.cs
- CellParaClient.cs
- FixedSOMPageElement.cs
- CompositeFontFamily.cs
- SuppressIldasmAttribute.cs
- DataListItem.cs
- autovalidator.cs
- UnsafeNativeMethods.cs
- RowParagraph.cs
- WindowsScrollBar.cs
- DayRenderEvent.cs
- CellQuery.cs
- DataGridViewRowsAddedEventArgs.cs
- Int64AnimationBase.cs
- ProfileProvider.cs
- ReflectionHelper.cs
- FixedSchema.cs
- ConstructorNeedsTagAttribute.cs
- MultipleViewPattern.cs
- _CookieModule.cs
- ResourceReferenceExpressionConverter.cs
- Base64Decoder.cs
- ControlParameter.cs
- TraceContextRecord.cs
- InkCanvasSelection.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- XmlSchemaAny.cs
- ServiceInfo.cs
- KeyToListMap.cs
- TableDetailsRow.cs
- TemplateBindingExtension.cs
- PassportPrincipal.cs
- NavigationFailedEventArgs.cs
- ReachDocumentReferenceSerializer.cs
- ListBox.cs
- HwndHostAutomationPeer.cs
- ToolStripItemTextRenderEventArgs.cs
- Int64Storage.cs
- BamlLocalizableResource.cs
- DataSysAttribute.cs
- BuildResult.cs
- XsltException.cs
- PerformanceCounterLib.cs
- FormatterConverter.cs
- ResourceProperty.cs
- FlowSwitch.cs
- DataObject.cs
- LoginView.cs
- TextTreeFixupNode.cs
- IntranetCredentialPolicy.cs
- BindingCollection.cs
- CollectionViewGroup.cs
- CodeDirectiveCollection.cs
- UndoEngine.cs
- NamedObject.cs
- SpeechRecognitionEngine.cs
- FixedSchema.cs
- CodeTypeMemberCollection.cs
- AlignmentYValidation.cs
- Dispatcher.cs
- pingexception.cs
- Oid.cs
- CmsInterop.cs
- ListenerServiceInstallComponent.cs
- ParserContext.cs
- ImageKeyConverter.cs
- BufferedMessageData.cs
- ContextStaticAttribute.cs
- TextMarkerSource.cs
- ModuleElement.cs
- CreateUserErrorEventArgs.cs
- VirtualPathUtility.cs
- IxmlLineInfo.cs
- FieldNameLookup.cs
- PreProcessInputEventArgs.cs
- TimersDescriptionAttribute.cs
- OleDbCommandBuilder.cs
- ExtendedPropertyInfo.cs
- GridViewPageEventArgs.cs
- SafeProcessHandle.cs
- RawStylusActions.cs
- ObjectManager.cs
- AncillaryOps.cs
- ByteStreamBufferedMessageData.cs