Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardProofToken.cs / 1 / InfoCardProofToken.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Selectors { using System; using System.IdentityModel.Tokens; using System.IdentityModel.Policy; using System.IdentityModel.Claims; using System.Collections.Generic; using System.Collections.ObjectModel; // // Summary: // This class implements a SecurityToken to wrap a remoted crypto key. It provides indirect // access to the private proof key associated with a released token. // internal class InfoCardProofToken : SecurityToken, IDisposable { string m_id; DateTime m_expiration; ReadOnlyCollectionm_securityKeys; SecurityKey m_securityKey; public InfoCardProofToken( AsymmetricCryptoHandle cryptoHandle, DateTime expiration ) : this( expiration ) { InitCrypto( new InfoCardAsymmetricCrypto( cryptoHandle ) ); } public InfoCardProofToken( SymmetricCryptoHandle cryptoHandle, DateTime expiration ) : this( expiration ) { InitCrypto( new InfoCardSymmetricCrypto( cryptoHandle ) ); } private InfoCardProofToken( DateTime expiration ) : base() { m_id = Guid.NewGuid().ToString(); m_expiration = expiration.ToUniversalTime(); } public override string Id { get { return m_id; } } public override ReadOnlyCollection SecurityKeys { get { return m_securityKeys; } } public override DateTime ValidTo { get { return m_expiration; } } public override DateTime ValidFrom { get { return DateTime.UtcNow; } } private void InitCrypto(SecurityKey securityKey) { m_securityKey = securityKey; List securityKeys = new List (1); securityKeys.Add(securityKey); m_securityKeys = securityKeys.AsReadOnly(); } public void Dispose() { m_securityKeys = null; ((IDisposable)m_securityKey).Dispose(); } } } // 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
- XmlTextReader.cs
- FloatAverageAggregationOperator.cs
- SafeFileMappingHandle.cs
- DispatcherExceptionEventArgs.cs
- EntityRecordInfo.cs
- DispatcherSynchronizationContext.cs
- LocalBuilder.cs
- ConfigurationCollectionAttribute.cs
- GridViewCellAutomationPeer.cs
- WindowAutomationPeer.cs
- SchemaElementDecl.cs
- StructuredTypeInfo.cs
- DataRow.cs
- WebRequestModuleElementCollection.cs
- InternalConfigSettingsFactory.cs
- LineServicesRun.cs
- ColumnMapProcessor.cs
- DataSvcMapFileSerializer.cs
- Image.cs
- HitTestParameters.cs
- CollectionAdapters.cs
- AssociationTypeEmitter.cs
- _ConnectionGroup.cs
- ErrorProvider.cs
- XmlSchemaInferenceException.cs
- Throw.cs
- AVElementHelper.cs
- ToolStripSplitButton.cs
- Vector3D.cs
- ProviderSettingsCollection.cs
- HttpValueCollection.cs
- MultiTrigger.cs
- DbXmlEnabledProviderManifest.cs
- __Filters.cs
- ReachObjectContext.cs
- WebPartEditorOkVerb.cs
- DBCommandBuilder.cs
- VariableValue.cs
- FileDialog_Vista_Interop.cs
- LeaseManager.cs
- HttpClientChannel.cs
- DownloadProgressEventArgs.cs
- WindowsListViewSubItem.cs
- DbDataReader.cs
- SqlBulkCopy.cs
- UriTemplateMatchException.cs
- CodeDomConfigurationHandler.cs
- RegistrationServices.cs
- Registry.cs
- PropertyGroupDescription.cs
- CanonicalizationDriver.cs
- DockingAttribute.cs
- _SingleItemRequestCache.cs
- Process.cs
- TranslateTransform.cs
- PersonalizableTypeEntry.cs
- ProxyWebPartManagerDesigner.cs
- ScrollableControl.cs
- _KerberosClient.cs
- KeyedHashAlgorithm.cs
- ConstraintStruct.cs
- ChangePasswordDesigner.cs
- _FtpDataStream.cs
- DrawingCollection.cs
- PaintValueEventArgs.cs
- IOException.cs
- CustomError.cs
- CompoundFileStorageReference.cs
- XmlnsCompatibleWithAttribute.cs
- ColumnTypeConverter.cs
- Rfc2898DeriveBytes.cs
- RadioButtonBaseAdapter.cs
- ListViewGroupItemCollection.cs
- MetadataArtifactLoaderCompositeResource.cs
- TypedDataSourceCodeGenerator.cs
- ScriptReferenceEventArgs.cs
- ToolStripDropDownMenu.cs
- CorrelationKeyCalculator.cs
- StringToken.cs
- VisualStyleInformation.cs
- FacetValueContainer.cs
- ManualResetEvent.cs
- FixedHighlight.cs
- DynamicActionMessageFilter.cs
- followingquery.cs
- HttpResponse.cs
- WeakHashtable.cs
- DataGridViewButtonCell.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- ProxyWebPart.cs
- ByeOperationAsyncResult.cs
- XsdValidatingReader.cs
- NativeMethods.cs
- PropVariant.cs
- ECDsa.cs
- DateTimeValueSerializerContext.cs
- SafeProcessHandle.cs
- ErrorHandler.cs
- TopClause.cs
- BitmapEffectGroup.cs