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
- Constraint.cs
- HMACSHA384.cs
- Vertex.cs
- BitmapEffectGroup.cs
- BindingExpressionUncommonField.cs
- ResourceWriter.cs
- ObjectContextServiceProvider.cs
- HandlerFactoryWrapper.cs
- AxHost.cs
- TextSelectionHighlightLayer.cs
- TextServicesPropertyRanges.cs
- SqlUserDefinedAggregateAttribute.cs
- WebPartConnectVerb.cs
- DataMisalignedException.cs
- ReversePositionQuery.cs
- CodeDomDesignerLoader.cs
- ChannelCacheSettings.cs
- TextFindEngine.cs
- SequentialUshortCollection.cs
- BindableTemplateBuilder.cs
- ResourcesBuildProvider.cs
- NetworkCredential.cs
- CorrelationValidator.cs
- XmlSerializerAssemblyAttribute.cs
- SqlSelectClauseBuilder.cs
- SqlTriggerAttribute.cs
- DataGridViewComboBoxEditingControl.cs
- StylusOverProperty.cs
- FontNamesConverter.cs
- SmtpReplyReaderFactory.cs
- PromptStyle.cs
- WebCategoryAttribute.cs
- XNodeSchemaApplier.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- PersistenceParticipant.cs
- EncodingTable.cs
- DocumentViewer.cs
- ExtendedPropertyDescriptor.cs
- SqlError.cs
- TraceEventCache.cs
- EpmHelper.cs
- SmtpTransport.cs
- SiteMapNodeItemEventArgs.cs
- DBCommandBuilder.cs
- UnSafeCharBuffer.cs
- Converter.cs
- CodeBinaryOperatorExpression.cs
- DNS.cs
- ReferenceEqualityComparer.cs
- DataGridViewTopLeftHeaderCell.cs
- DataSourceControl.cs
- NullableLongSumAggregationOperator.cs
- LayoutTableCell.cs
- ExternalException.cs
- SqlDataSourceCommandEventArgs.cs
- NaturalLanguageHyphenator.cs
- PropertyConverter.cs
- HttpListenerContext.cs
- KeyValuePair.cs
- ConfigurationErrorsException.cs
- OleDbReferenceCollection.cs
- TraceSection.cs
- QilReference.cs
- Match.cs
- GridView.cs
- ObjectStateFormatter.cs
- NumericUpDownAcceleration.cs
- Attributes.cs
- ServiceContractAttribute.cs
- XNodeSchemaApplier.cs
- ProcessHostConfigUtils.cs
- EdmMember.cs
- TrayIconDesigner.cs
- QilDataSource.cs
- SQLBinaryStorage.cs
- ValidatorCollection.cs
- Propagator.cs
- PagerSettings.cs
- CompositeCollectionView.cs
- SmiXetterAccessMap.cs
- WorkflowRuntimeServicesBehavior.cs
- NamedObject.cs
- IgnorePropertiesAttribute.cs
- ResourceSet.cs
- SafeIUnknown.cs
- TextServicesDisplayAttribute.cs
- ToolStripTextBox.cs
- OdbcDataReader.cs
- Rules.cs
- BooleanAnimationUsingKeyFrames.cs
- glyphs.cs
- StringBlob.cs
- Dynamic.cs
- ModelPerspective.cs
- SchemaElementLookUpTable.cs
- LayoutDump.cs
- StaticExtension.cs
- TextBreakpoint.cs
- UrlPropertyAttribute.cs
- FrugalList.cs