Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / EncryptedKeyIdentifierClause.cs / 1 / EncryptedKeyIdentifierClause.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.IdentityModel.Tokens { using System.Globalization; sealed public class EncryptedKeyIdentifierClause : BinaryKeyIdentifierClause { readonly string carriedKeyName; readonly string encryptionMethod; readonly SecurityKeyIdentifier encryptingKeyIdentifier; public EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod) : this(encryptedKey, encryptionMethod, null) { } public EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod, SecurityKeyIdentifier encryptingKeyIdentifier) : this(encryptedKey, encryptionMethod, encryptingKeyIdentifier, null) { } public EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod, SecurityKeyIdentifier encryptingKeyIdentifier, string carriedKeyName) : this(encryptedKey, encryptionMethod, encryptingKeyIdentifier, carriedKeyName, true, null, 0) { } public EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod, SecurityKeyIdentifier encryptingKeyIdentifier, string carriedKeyName, byte[] derivationNonce, int derivationLength) : this(encryptedKey, encryptionMethod, encryptingKeyIdentifier, carriedKeyName, true, derivationNonce, derivationLength) { } internal EncryptedKeyIdentifierClause(byte[] encryptedKey, string encryptionMethod, SecurityKeyIdentifier encryptingKeyIdentifier, string carriedKeyName, bool cloneBuffer, byte[] derivationNonce, int derivationLength) : base("http://www.w3.org/2001/04/xmlenc#EncryptedKey", encryptedKey, cloneBuffer, derivationNonce, derivationLength) { if (encryptionMethod == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("encryptionMethod"); } this.carriedKeyName = carriedKeyName; this.encryptionMethod = encryptionMethod; this.encryptingKeyIdentifier = encryptingKeyIdentifier; } public string CarriedKeyName { get { return this.carriedKeyName; } } public SecurityKeyIdentifier EncryptingKeyIdentifier { get { return this.encryptingKeyIdentifier; } } public string EncryptionMethod { get { return this.encryptionMethod; } } public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause) { EncryptedKeyIdentifierClause that = keyIdentifierClause as EncryptedKeyIdentifierClause; // PreSharp Bug: Parameter 'that' to this public method must be validated: A null-dereference can occur here. #pragma warning suppress 56506 return ReferenceEquals(this, that) || (that != null && that.Matches(this.GetRawBuffer(), this.encryptionMethod, this.carriedKeyName)); } public bool Matches(byte[] encryptedKey, string encryptionMethod, string carriedKeyName) { return Matches(encryptedKey) && this.encryptionMethod == encryptionMethod && this.carriedKeyName == carriedKeyName; } public byte[] GetEncryptedKey() { return GetBuffer(); } public override string ToString() { return string.Format(CultureInfo.InvariantCulture, "EncryptedKeyIdentifierClause(EncryptedKey = {0}, Method '{1}')", Convert.ToBase64String(GetRawBuffer()), this.EncryptionMethod); } } } // 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
- Transform3D.cs
- UrlMapping.cs
- ConnectionPointCookie.cs
- MaterialGroup.cs
- PortCache.cs
- WebFormDesignerActionService.cs
- InputLangChangeRequestEvent.cs
- SharedRuntimeState.cs
- EmptyEnumerator.cs
- DependencyStoreSurrogate.cs
- lengthconverter.cs
- UrlMappingsSection.cs
- PathGeometry.cs
- InteropBitmapSource.cs
- XmlBoundElement.cs
- Debug.cs
- TripleDESCryptoServiceProvider.cs
- DocumentGridContextMenu.cs
- DetailsViewPagerRow.cs
- MeasureData.cs
- SerializationInfoEnumerator.cs
- Int32Rect.cs
- MenuItemCollection.cs
- CatalogZoneBase.cs
- NetworkInformationPermission.cs
- RangeValuePattern.cs
- RelationshipEndCollection.cs
- NestedContainer.cs
- __TransparentProxy.cs
- TreeViewHitTestInfo.cs
- HttpModuleActionCollection.cs
- BuildManagerHost.cs
- DataGridViewRowStateChangedEventArgs.cs
- CodeSnippetExpression.cs
- RoleServiceManager.cs
- VideoDrawing.cs
- BoolExpr.cs
- CapabilitiesPattern.cs
- ManagedIStream.cs
- GridViewColumn.cs
- Size.cs
- ObjectIDGenerator.cs
- AssemblyInfo.cs
- TypeUtil.cs
- UpdateTracker.cs
- SqlHelper.cs
- ActiveXSite.cs
- OleDbSchemaGuid.cs
- MexBindingBindingCollectionElement.cs
- GenericWebPart.cs
- SecurityUtils.cs
- smtppermission.cs
- DataTableCollection.cs
- CommentEmitter.cs
- MimeTypePropertyAttribute.cs
- ClientScriptManagerWrapper.cs
- SchemaConstraints.cs
- TypeTypeConverter.cs
- ValidatedControlConverter.cs
- QilIterator.cs
- Knowncolors.cs
- GeneralTransform.cs
- DataViewManager.cs
- RealizationContext.cs
- DrawListViewSubItemEventArgs.cs
- PolicyStatement.cs
- EntityKey.cs
- odbcmetadatacolumnnames.cs
- AvTraceDetails.cs
- XmlDownloadManager.cs
- Transform.cs
- WebConfigurationManager.cs
- PenCursorManager.cs
- Executor.cs
- Freezable.cs
- RewritingPass.cs
- DefaultTypeArgumentAttribute.cs
- NativeObjectSecurity.cs
- IDictionary.cs
- HashHelper.cs
- GridViewColumnHeaderAutomationPeer.cs
- DrawingAttributes.cs
- WindowsToolbarAsMenu.cs
- ExpressionWriter.cs
- Decoder.cs
- BufferModeSettings.cs
- DescriptionCreator.cs
- SQLDecimalStorage.cs
- GridSplitterAutomationPeer.cs
- XpsSerializationManagerAsync.cs
- XmlBuffer.cs
- ThicknessKeyFrameCollection.cs
- FrameworkObject.cs
- CommandHelper.cs
- HostedHttpTransportManager.cs
- DnsPermission.cs
- TextEditorContextMenu.cs
- ClickablePoint.cs
- ConfigurationManager.cs
- ImageAnimator.cs