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
- PageOutputColor.cs
- ComplexTypeEmitter.cs
- ActivitiesCollection.cs
- ZipIOExtraFieldPaddingElement.cs
- NativeMethods.cs
- TargetException.cs
- EditorPartDesigner.cs
- TagNameToTypeMapper.cs
- XmlSchemaSimpleTypeUnion.cs
- ReaderOutput.cs
- URLAttribute.cs
- EventProviderWriter.cs
- ApplicationTrust.cs
- XamlReader.cs
- UIInitializationException.cs
- TableStyle.cs
- RecognizedPhrase.cs
- EventlogProvider.cs
- UrlAuthFailedErrorFormatter.cs
- StyleSelector.cs
- RectangleHotSpot.cs
- ImageBrush.cs
- BindableTemplateBuilder.cs
- ElementAtQueryOperator.cs
- UIElement3D.cs
- Pen.cs
- DbParameterHelper.cs
- EndpointInstanceProvider.cs
- DesignerTransaction.cs
- ServiceNameElement.cs
- RTLAwareMessageBox.cs
- CryptoStream.cs
- OutputWindow.cs
- DefaultObjectMappingItemCollection.cs
- CoTaskMemHandle.cs
- TaskFileService.cs
- Control.cs
- StringReader.cs
- linebase.cs
- CookieProtection.cs
- FixedSOMGroup.cs
- QuotedStringWriteStateInfo.cs
- MenuItemBinding.cs
- EasingKeyFrames.cs
- IndexExpression.cs
- XamlNamespaceHelper.cs
- DocumentPageViewAutomationPeer.cs
- ResizeGrip.cs
- ExtendedPropertyCollection.cs
- DataGridLengthConverter.cs
- WebServiceEnumData.cs
- CheckoutException.cs
- DataContract.cs
- SerialPinChanges.cs
- MarshalByValueComponent.cs
- MetaModel.cs
- GroupLabel.cs
- SettingsPropertyCollection.cs
- PEFileReader.cs
- ScrollBarRenderer.cs
- BezierSegment.cs
- UnsafeNativeMethods.cs
- ReliabilityContractAttribute.cs
- HttpsChannelListener.cs
- Baml6Assembly.cs
- BindingObserver.cs
- ObjectSecurity.cs
- RegionInfo.cs
- SafeThemeHandle.cs
- Parameter.cs
- MulticastIPAddressInformationCollection.cs
- Number.cs
- TemplateKey.cs
- DoubleAnimationBase.cs
- WebPartCollection.cs
- LocalizableAttribute.cs
- JpegBitmapDecoder.cs
- _SSPISessionCache.cs
- SamlAdvice.cs
- HostProtectionPermission.cs
- DecoderFallback.cs
- SHA384Managed.cs
- ListViewAutomationPeer.cs
- CodeVariableReferenceExpression.cs
- input.cs
- PageEventArgs.cs
- TogglePatternIdentifiers.cs
- DataStorage.cs
- PeerNameRecord.cs
- StaticDataManager.cs
- DataRecordInfo.cs
- DeclarationUpdate.cs
- HttpServerVarsCollection.cs
- ConnectorDragDropGlyph.cs
- RepeatInfo.cs
- DbTransaction.cs
- RuleSettingsCollection.cs
- _Events.cs
- Rss20FeedFormatter.cs
- XmlSchemaAll.cs