Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / Client / System / IdentityModel / Selectors / InfoCardProofToken.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DependencyPropertyDescriptor.cs
- TableDetailsRow.cs
- DataTableClearEvent.cs
- DataException.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- CorrelationManager.cs
- GenerateScriptTypeAttribute.cs
- DeobfuscatingStream.cs
- FixedTextBuilder.cs
- PropertyValidationContext.cs
- SlotInfo.cs
- TemplateBindingExtensionConverter.cs
- MimeFormatExtensions.cs
- AssemblyAssociatedContentFileAttribute.cs
- RequestQueryParser.cs
- FontFamily.cs
- DictionaryBase.cs
- DBConcurrencyException.cs
- XmlDataSourceView.cs
- DesigntimeLicenseContextSerializer.cs
- DataServiceOperationContext.cs
- StateChangeEvent.cs
- TreeBuilder.cs
- DbModificationCommandTree.cs
- RowBinding.cs
- WorkItem.cs
- Deflater.cs
- ColorKeyFrameCollection.cs
- SuppressIldasmAttribute.cs
- QueryTreeBuilder.cs
- XmlWrappingReader.cs
- TraceContext.cs
- HtmlMeta.cs
- Point3DAnimationUsingKeyFrames.cs
- InvalidDataException.cs
- LinqDataView.cs
- EncryptedReference.cs
- OutputBuffer.cs
- FormsAuthenticationConfiguration.cs
- UnauthorizedWebPart.cs
- FontFamilyConverter.cs
- DependencyProperty.cs
- CapabilitiesUse.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- GiveFeedbackEventArgs.cs
- HiddenFieldPageStatePersister.cs
- Validator.cs
- ObjectItemLoadingSessionData.cs
- objectresult_tresulttype.cs
- XslTransform.cs
- StoreAnnotationsMap.cs
- _OverlappedAsyncResult.cs
- BaseParser.cs
- SamlSecurityTokenAuthenticator.cs
- PropertyInformationCollection.cs
- DbSetClause.cs
- RichListBox.cs
- ExtendLockAsyncResult.cs
- WindowsNonControl.cs
- StringKeyFrameCollection.cs
- TiffBitmapEncoder.cs
- ServiceDesigner.cs
- CheckBox.cs
- KeyGesture.cs
- MetaData.cs
- XmlMtomReader.cs
- CodeExpressionRuleDeclaration.cs
- SHA256.cs
- CommonXSendMessage.cs
- Privilege.cs
- CompositeCollectionView.cs
- DivideByZeroException.cs
- BinaryObjectReader.cs
- DesigntimeLicenseContext.cs
- XpsColorContext.cs
- WorkflowTransactionService.cs
- LineUtil.cs
- WebPartDescription.cs
- Int16Storage.cs
- Model3DCollection.cs
- SettingsContext.cs
- WebPartCollection.cs
- SelectionHighlightInfo.cs
- HtmlAnchor.cs
- ArgumentOutOfRangeException.cs
- ImageButton.cs
- EnumValidator.cs
- NetworkInformationException.cs
- MasterPageCodeDomTreeGenerator.cs
- SafeFreeMibTable.cs
- GenericEnumConverter.cs
- XmlAnyElementAttributes.cs
- DataGridClipboardHelper.cs
- NameTable.cs
- RoutingSection.cs
- WsdlBuildProvider.cs
- DataGridTextBoxColumn.cs
- ThemeDirectoryCompiler.cs
- ObjectDataSource.cs
- HMACSHA384.cs