Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / BinarySecretKeyIdentifierClause.cs / 1 / BinarySecretKeyIdentifierClause.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.ServiceModel.Security
{
using System.IdentityModel.Tokens;
using System.ServiceModel;
using System.ServiceModel.Security.Tokens;
public class BinarySecretKeyIdentifierClause : BinaryKeyIdentifierClause
{
InMemorySymmetricSecurityKey symmetricKey;
public BinarySecretKeyIdentifierClause(byte[] key)
: this(key, true)
{
}
public BinarySecretKeyIdentifierClause(byte[] key, bool cloneBuffer)
: this(key, cloneBuffer, null, 0)
{
}
public BinarySecretKeyIdentifierClause(byte[] key, bool cloneBuffer, byte[] derivationNonce, int derivationLength)
: base(XD.TrustFeb2005Dictionary.BinarySecretClauseType.Value, key, cloneBuffer, derivationNonce, derivationLength)
{
}
public byte[] GetKeyBytes()
{
return GetBuffer();
}
public override bool CanCreateKey
{
get { return true; }
}
public override SecurityKey CreateKey()
{
if (this.symmetricKey == null)
this.symmetricKey = new InMemorySymmetricSecurityKey(GetBuffer(), false);
return this.symmetricKey;
}
public override bool Matches(SecurityKeyIdentifierClause keyIdentifierClause)
{
BinarySecretKeyIdentifierClause that = keyIdentifierClause as BinarySecretKeyIdentifierClause;
// 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()));
}
}
}
// 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
- RtfToXamlLexer.cs
- UnionCqlBlock.cs
- CircleHotSpot.cs
- GroupBoxRenderer.cs
- SortedDictionary.cs
- HMACSHA256.cs
- XamlStackWriter.cs
- SoapInteropTypes.cs
- TrackingRecord.cs
- MatrixConverter.cs
- TransformerInfo.cs
- DynamicDocumentPaginator.cs
- TreeNodeConverter.cs
- BulletChrome.cs
- TableMethodGenerator.cs
- ContentElementAutomationPeer.cs
- SubclassTypeValidatorAttribute.cs
- WeakReferenceList.cs
- SystemIcons.cs
- VisualTreeHelper.cs
- ListItemCollection.cs
- MimeTypePropertyAttribute.cs
- Thumb.cs
- FormsIdentity.cs
- ListViewItem.cs
- MILUtilities.cs
- ToolStripSplitStackLayout.cs
- ApplicationSettingsBase.cs
- Misc.cs
- InfiniteTimeSpanConverter.cs
- WebPartConnection.cs
- ConfigurationManagerInternal.cs
- HostVisual.cs
- FixedMaxHeap.cs
- ClientEndpointLoader.cs
- DocComment.cs
- ActivationArguments.cs
- ToolTipAutomationPeer.cs
- SessionParameter.cs
- LinkDescriptor.cs
- ProtectedProviderSettings.cs
- RuntimeArgumentHandle.cs
- WebPartConnectionsConnectVerb.cs
- DefaultDiscoveryServiceExtension.cs
- Identity.cs
- ObjectSerializerFactory.cs
- XPathParser.cs
- RegexCompiler.cs
- NonSerializedAttribute.cs
- OracleBFile.cs
- PngBitmapDecoder.cs
- OuterGlowBitmapEffect.cs
- BmpBitmapEncoder.cs
- PriorityRange.cs
- ClientApiGenerator.cs
- SqlBooleanMismatchVisitor.cs
- ComUdtElement.cs
- XhtmlBasicControlAdapter.cs
- Model3D.cs
- BitmapFrame.cs
- SHA256Managed.cs
- HttpModuleAction.cs
- DataGridViewIntLinkedList.cs
- CounterNameConverter.cs
- OrderByExpression.cs
- CustomDictionarySources.cs
- ControlParameter.cs
- PriorityChain.cs
- TemplateControlCodeDomTreeGenerator.cs
- XmlArrayItemAttributes.cs
- HiddenFieldDesigner.cs
- InvalidWMPVersionException.cs
- GradientStop.cs
- LocalizableAttribute.cs
- NotifyIcon.cs
- AddInSegmentDirectoryNotFoundException.cs
- ResetableIterator.cs
- storagemappingitemcollection.viewdictionary.cs
- TypeInitializationException.cs
- xmlglyphRunInfo.cs
- TemplateNameScope.cs
- XmlByteStreamReader.cs
- WSAddressing10ProblemHeaderQNameFault.cs
- TemplateBamlTreeBuilder.cs
- DataGridViewCellFormattingEventArgs.cs
- TextDecorationCollectionConverter.cs
- GiveFeedbackEventArgs.cs
- DriveInfo.cs
- XPathParser.cs
- SystemBrushes.cs
- SQLStringStorage.cs
- DynamicQueryableWrapper.cs
- COAUTHINFO.cs
- BindingNavigator.cs
- CatalogPartCollection.cs
- XPathAxisIterator.cs
- SimpleHandlerBuildProvider.cs
- ComAdminInterfaces.cs
- ValidatingPropertiesEventArgs.cs
- PrintDocument.cs