Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / IdentityModel / System / IdentityModel / Tokens / SecurityKeyIdentifierClause.cs / 1305376 / SecurityKeyIdentifierClause.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Tokens { // All subclasses are required to be thread-safe and immutable // Self-resolving clauses such as RSA and X509 raw data should // override CanCreateKey and return true, and implement // CreateKey() public abstract class SecurityKeyIdentifierClause { readonly string clauseType; byte[] derivationNonce; int derivationLength; protected SecurityKeyIdentifierClause(string clauseType) : this(clauseType, null, 0) { } protected SecurityKeyIdentifierClause(string clauseType, byte[] nonce, int length) { this.clauseType = clauseType; this.derivationNonce = nonce; this.derivationLength = length; } public virtual bool CanCreateKey { get { return false; } } public string ClauseType { get { return this.clauseType; } } public virtual SecurityKey CreateKey() { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.KeyIdentifierClauseDoesNotSupportKeyCreation))); } public virtual bool Matches(SecurityKeyIdentifierClause keyIdentifierClause) { return ReferenceEquals(this, keyIdentifierClause); } public byte[] GetDerivationNonce() { return (this.derivationNonce != null) ? (byte[])this.derivationNonce.Clone() : null; } public int DerivationLength { get { return this.derivationLength; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace System.IdentityModel.Tokens { // All subclasses are required to be thread-safe and immutable // Self-resolving clauses such as RSA and X509 raw data should // override CanCreateKey and return true, and implement // CreateKey() public abstract class SecurityKeyIdentifierClause { readonly string clauseType; byte[] derivationNonce; int derivationLength; protected SecurityKeyIdentifierClause(string clauseType) : this(clauseType, null, 0) { } protected SecurityKeyIdentifierClause(string clauseType, byte[] nonce, int length) { this.clauseType = clauseType; this.derivationNonce = nonce; this.derivationLength = length; } public virtual bool CanCreateKey { get { return false; } } public string ClauseType { get { return this.clauseType; } } public virtual SecurityKey CreateKey() { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.KeyIdentifierClauseDoesNotSupportKeyCreation))); } public virtual bool Matches(SecurityKeyIdentifierClause keyIdentifierClause) { return ReferenceEquals(this, keyIdentifierClause); } public byte[] GetDerivationNonce() { return (this.derivationNonce != null) ? (byte[])this.derivationNonce.Clone() : null; } public int DerivationLength { get { return this.derivationLength; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CloudCollection.cs
- FloaterParaClient.cs
- IteratorFilter.cs
- WebScriptEndpoint.cs
- JavaScriptString.cs
- HatchBrush.cs
- SHA1CryptoServiceProvider.cs
- ComEventsInfo.cs
- DefaultHttpHandler.cs
- ByteConverter.cs
- TerminatorSinks.cs
- BitmapScalingModeValidation.cs
- SafeSystemMetrics.cs
- HttpContext.cs
- ReaderWriterLock.cs
- ProcessThread.cs
- Site.cs
- StyleSelector.cs
- TypeUtil.cs
- WithParamAction.cs
- XamlTemplateSerializer.cs
- EntityType.cs
- WebHttpElement.cs
- ValueUnavailableException.cs
- TCPClient.cs
- BindableAttribute.cs
- AssemblyLoader.cs
- InternalCache.cs
- WebPartsSection.cs
- DeploymentSection.cs
- PriorityQueue.cs
- Gdiplus.cs
- ParserExtension.cs
- RequestBringIntoViewEventArgs.cs
- TreeNodeEventArgs.cs
- BaseTemplateParser.cs
- LocalValueEnumerator.cs
- TypeLoadException.cs
- MailBnfHelper.cs
- BuildProvider.cs
- ImmutableClientRuntime.cs
- ComboBoxAutomationPeer.cs
- AttributeProviderAttribute.cs
- BinarySerializer.cs
- Operators.cs
- ErrorRuntimeConfig.cs
- QilInvokeLateBound.cs
- DataControlButton.cs
- CallbackValidatorAttribute.cs
- XmlSchemaSimpleTypeUnion.cs
- HMACRIPEMD160.cs
- Base64Decoder.cs
- CompiledXpathExpr.cs
- QilParameter.cs
- Misc.cs
- XmlAnyElementAttributes.cs
- StylusEditingBehavior.cs
- Brush.cs
- CqlLexer.cs
- PeekCompletedEventArgs.cs
- RangeValuePattern.cs
- StickyNoteHelper.cs
- securestring.cs
- FormsAuthenticationUserCollection.cs
- TransactionFlowElement.cs
- ResourceContainer.cs
- RelativeSource.cs
- XmlMembersMapping.cs
- LinkButton.cs
- PlatformCulture.cs
- PersonalizationProviderHelper.cs
- TextFormatterHost.cs
- EncryptedData.cs
- CategoryAttribute.cs
- MessageQueuePermissionAttribute.cs
- DataGridColumnHeaderItemAutomationPeer.cs
- RegistryKey.cs
- Rotation3D.cs
- FunctionImportElement.cs
- DesignerEditorPartChrome.cs
- MaskedTextBoxDesigner.cs
- Double.cs
- BaseTemplateBuildProvider.cs
- AssertValidation.cs
- WinEventHandler.cs
- BrowserTree.cs
- MarkedHighlightComponent.cs
- Add.cs
- PartitionResolver.cs
- PreservationFileWriter.cs
- FreezableOperations.cs
- ToolStripContentPanel.cs
- MonthCalendar.cs
- LineBreak.cs
- ThreadStateException.cs
- ObjectList.cs
- COM2IDispatchConverter.cs
- PeerNameRegistration.cs
- DataControlFieldHeaderCell.cs
- Fx.cs