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
- InvalidPropValue.cs
- CircleEase.cs
- SqlBulkCopyColumnMapping.cs
- OutputScopeManager.cs
- EntityConnectionStringBuilder.cs
- ProfileGroupSettings.cs
- XmlNavigatorFilter.cs
- XmlComplianceUtil.cs
- XmlSchemaSimpleContentRestriction.cs
- BaseContextMenu.cs
- GrammarBuilderBase.cs
- RepeaterDataBoundAdapter.cs
- PrintPageEvent.cs
- ExpandCollapsePattern.cs
- DispatcherObject.cs
- _RegBlobWebProxyDataBuilder.cs
- EmbeddedMailObjectCollectionEditor.cs
- FormatterServicesNoSerializableCheck.cs
- ViewgenGatekeeper.cs
- EditorBrowsableAttribute.cs
- ElementFactory.cs
- OracleDataAdapter.cs
- PointF.cs
- IndexingContentUnit.cs
- MulticastOption.cs
- TypeLoadException.cs
- WorkflowRuntimeServiceElementCollection.cs
- ContainerParagraph.cs
- ChannelCacheSettings.cs
- WsdlBuildProvider.cs
- LineInfo.cs
- ScaleTransform.cs
- ObjectSecurityT.cs
- Int32CollectionValueSerializer.cs
- ImpersonationContext.cs
- SecurityElement.cs
- KnownTypeDataContractResolver.cs
- DataTemplateSelector.cs
- DbExpressionBuilder.cs
- UserControlAutomationPeer.cs
- TransactionTable.cs
- WebPartVerb.cs
- NavigatorInput.cs
- ParameterBuilder.cs
- MetadataException.cs
- MetabaseReader.cs
- Propagator.ExtentPlaceholderCreator.cs
- ToolboxDataAttribute.cs
- InteropTrackingRecord.cs
- GenericTypeParameterBuilder.cs
- WebRequestModuleElementCollection.cs
- updateconfighost.cs
- LogWriteRestartAreaState.cs
- WhiteSpaceTrimStringConverter.cs
- ChtmlPageAdapter.cs
- FloaterParagraph.cs
- DefaultTraceListener.cs
- ProtocolViolationException.cs
- NativeMethods.cs
- DesignBindingEditor.cs
- FileSystemInfo.cs
- SerializationStore.cs
- ZipIOFileItemStream.cs
- SafeEventLogReadHandle.cs
- Translator.cs
- SystemIPv6InterfaceProperties.cs
- AnalyzedTree.cs
- VectorAnimationBase.cs
- _DigestClient.cs
- CodeMethodReturnStatement.cs
- CodeConstructor.cs
- DataGridTablesFactory.cs
- ProcessThreadDesigner.cs
- GeometryCollection.cs
- InheritanceAttribute.cs
- sqlpipe.cs
- XmlProcessingInstruction.cs
- ZipIOModeEnforcingStream.cs
- EventWaitHandleSecurity.cs
- BitmapScalingModeValidation.cs
- CallContext.cs
- _NetRes.cs
- XmlSchemaInferenceException.cs
- CurrentChangingEventArgs.cs
- XmlAnyElementAttributes.cs
- _LazyAsyncResult.cs
- FocusManager.cs
- NumberAction.cs
- DocumentPageViewAutomationPeer.cs
- TextTreePropertyUndoUnit.cs
- IERequestCache.cs
- MultipleViewPatternIdentifiers.cs
- HashCryptoHandle.cs
- PermissionRequestEvidence.cs
- XsltLoader.cs
- QuaternionAnimationBase.cs
- SqlGatherProducedAliases.cs
- SizeChangedInfo.cs
- ElementFactory.cs
- TabItemWrapperAutomationPeer.cs