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
- KnownIds.cs
- BitmapEffect.cs
- DataViewSetting.cs
- LoginNameDesigner.cs
- IPHostEntry.cs
- ZoneMembershipCondition.cs
- ColorBlend.cs
- DataBindingCollection.cs
- EventDescriptor.cs
- DataGridViewCheckBoxColumn.cs
- ErrorLog.cs
- ActionFrame.cs
- SmiRequestExecutor.cs
- GcHandle.cs
- WebBrowserContainer.cs
- RoleProviderPrincipal.cs
- DynamicDataRouteHandler.cs
- BindingMemberInfo.cs
- LexicalChunk.cs
- Rect3DConverter.cs
- FontStretchConverter.cs
- ProcessHostServerConfig.cs
- StrokeNodeData.cs
- SafeMarshalContext.cs
- ToolStripItemEventArgs.cs
- SHA384Cng.cs
- LinqDataSourceValidationException.cs
- UnauthorizedAccessException.cs
- UnmanagedMemoryStream.cs
- PointCollection.cs
- OleDbSchemaGuid.cs
- DelegateArgumentReference.cs
- FeatureAttribute.cs
- BypassElementCollection.cs
- VisualBasicSettings.cs
- IdSpace.cs
- OdbcConnection.cs
- FactoryId.cs
- PersistenceProviderDirectory.cs
- sqlmetadatafactory.cs
- _Win32.cs
- RuleSetReference.cs
- RowParagraph.cs
- ReadOnlyTernaryTree.cs
- EqualityComparer.cs
- WasHostedComPlusFactory.cs
- ValueType.cs
- MULTI_QI.cs
- wmiprovider.cs
- RenderContext.cs
- ReadOnlyDataSource.cs
- SelectionHighlightInfo.cs
- NativeWindow.cs
- WindowsHyperlink.cs
- DesignerRegion.cs
- SqlDataReaderSmi.cs
- CallContext.cs
- StringFormat.cs
- AnimationStorage.cs
- WebPartMovingEventArgs.cs
- Line.cs
- ColorTranslator.cs
- SafeArrayRankMismatchException.cs
- ColumnCollectionEditor.cs
- RadioButtonFlatAdapter.cs
- _SpnDictionary.cs
- ResourceAssociationSet.cs
- CodeSubDirectoriesCollection.cs
- TextEmbeddedObject.cs
- HandledMouseEvent.cs
- CodeArgumentReferenceExpression.cs
- LinqMaximalSubtreeNominator.cs
- EventArgs.cs
- IndexerNameAttribute.cs
- SafePEFileHandle.cs
- ParameterToken.cs
- UndoEngine.cs
- SQLBinary.cs
- SessionIDManager.cs
- QEncodedStream.cs
- DataTableExtensions.cs
- XmlNamespaceMappingCollection.cs
- InvalidPropValue.cs
- FontCollection.cs
- Model3DGroup.cs
- DetailsView.cs
- AspNetHostingPermission.cs
- MasterPage.cs
- VisualProxy.cs
- TimersDescriptionAttribute.cs
- HttpHeaderCollection.cs
- TypeElement.cs
- TypeValidationEventArgs.cs
- SiteMapNodeItem.cs
- ListParagraph.cs
- BaseEntityWrapper.cs
- CommandDevice.cs
- TypeDescriptionProviderAttribute.cs
- _NegotiateClient.cs
- BooleanExpr.cs