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
- ClientApiGenerator.cs
- CheckableControlBaseAdapter.cs
- DocumentReferenceCollection.cs
- Wildcard.cs
- SerializationException.cs
- MetadataArtifactLoaderComposite.cs
- PropertyPathConverter.cs
- HttpCookie.cs
- XmlSchemaSequence.cs
- DesignTimeParseData.cs
- EntityDataSourceViewSchema.cs
- StretchValidation.cs
- SimpleHandlerFactory.cs
- AdjustableArrowCap.cs
- AuthenticationModulesSection.cs
- ProtocolsConfiguration.cs
- NamespaceInfo.cs
- DataBindEngine.cs
- EncryptedType.cs
- XmlSchemaValidator.cs
- EntityDataSourceViewSchema.cs
- RoleService.cs
- ProfileSection.cs
- ToolStripSplitButton.cs
- TaskScheduler.cs
- RestHandlerFactory.cs
- ScriptReference.cs
- QilReplaceVisitor.cs
- BinHexDecoder.cs
- PenLineJoinValidation.cs
- AliasedSlot.cs
- EventListener.cs
- InputScopeNameConverter.cs
- typedescriptorpermission.cs
- X509SubjectKeyIdentifierClause.cs
- PerfService.cs
- UIElement3DAutomationPeer.cs
- ThemeInfoAttribute.cs
- WaitHandle.cs
- EntityTypeEmitter.cs
- SqlWebEventProvider.cs
- ProgressBarAutomationPeer.cs
- Popup.cs
- BookmarkScope.cs
- ExtenderControl.cs
- EntityViewGenerator.cs
- XmlTextWriter.cs
- Attribute.cs
- DbParameterCollectionHelper.cs
- AdCreatedEventArgs.cs
- CollectionCodeDomSerializer.cs
- HtmlButton.cs
- ExtendedProtectionPolicyTypeConverter.cs
- base64Transforms.cs
- FontUnitConverter.cs
- SQLMoneyStorage.cs
- MethodBuilder.cs
- PointLight.cs
- OleDbException.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- DataSourceControlBuilder.cs
- FlowDecisionDesigner.xaml.cs
- HttpResponseMessageProperty.cs
- DataControlFieldCollection.cs
- GeneralTransform.cs
- XmlUtilWriter.cs
- EncryptedKeyHashIdentifierClause.cs
- ManualResetEvent.cs
- StringComparer.cs
- SafeRegistryKey.cs
- DbParameterHelper.cs
- TextRenderer.cs
- DrawToolTipEventArgs.cs
- RegexTypeEditor.cs
- ConstrainedDataObject.cs
- Permission.cs
- DataGridViewCellStyleContentChangedEventArgs.cs
- FormattedText.cs
- ClientBuildManager.cs
- PresentationAppDomainManager.cs
- Rect3D.cs
- sqlnorm.cs
- RequestCache.cs
- Keywords.cs
- StagingAreaInputItem.cs
- Int64AnimationUsingKeyFrames.cs
- DbDataRecord.cs
- MetafileHeaderWmf.cs
- TransformConverter.cs
- WindowsSolidBrush.cs
- SupportsEventValidationAttribute.cs
- WebProxyScriptElement.cs
- TdsValueSetter.cs
- ResponseStream.cs
- StreamGeometry.cs
- log.cs
- DrawingContext.cs
- ObjectItemCollection.cs
- DiagnosticTrace.cs
- SwitchCase.cs