Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WCF / infocard / common / managed / InfoCardCryptoHelper.cs / 1305376 / InfoCardCryptoHelper.cs
//------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace Microsoft.InfoCards { using System.IdentityModel.Tokens; using System.Security.Cryptography; using System.Security.Cryptography.Xml; // copied from IdentityModel\CryptoHelper.cs and they need to be kept in [....]. After V1, we need to rethink how we can have // a single place to ask this question. Perhaps even add it as an extensibility internal static class InfoCardCryptoHelper { internal static bool IsAsymmetricAlgorithm(string algorithm) { switch (algorithm) { case SecurityAlgorithms.DsaSha1Signature: case SecurityAlgorithms.RsaSha1Signature: case SecurityAlgorithms.RsaSha256Signature: case SecurityAlgorithms.RsaOaepKeyWrap: case SecurityAlgorithms.RsaV15KeyWrap: return true; default: return false; } } internal static bool IsSymmetricAlgorithm(string algorithm) { switch (algorithm) { case SecurityAlgorithms.HmacSha1Signature: case SecurityAlgorithms.HmacSha256Signature: case SecurityAlgorithms.Aes128Encryption: case SecurityAlgorithms.Aes192Encryption: case SecurityAlgorithms.Aes256Encryption: case SecurityAlgorithms.TripleDesEncryption: case SecurityAlgorithms.Aes128KeyWrap: case SecurityAlgorithms.Aes192KeyWrap: case SecurityAlgorithms.Aes256KeyWrap: case SecurityAlgorithms.TripleDesKeyWrap: case SecurityAlgorithms.Psha1KeyDerivation: case SecurityAlgorithms.Psha1KeyDerivationDec2005: return true; default: return false; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------- namespace Microsoft.InfoCards { using System.IdentityModel.Tokens; using System.Security.Cryptography; using System.Security.Cryptography.Xml; // copied from IdentityModel\CryptoHelper.cs and they need to be kept in [....]. After V1, we need to rethink how we can have // a single place to ask this question. Perhaps even add it as an extensibility internal static class InfoCardCryptoHelper { internal static bool IsAsymmetricAlgorithm(string algorithm) { switch (algorithm) { case SecurityAlgorithms.DsaSha1Signature: case SecurityAlgorithms.RsaSha1Signature: case SecurityAlgorithms.RsaSha256Signature: case SecurityAlgorithms.RsaOaepKeyWrap: case SecurityAlgorithms.RsaV15KeyWrap: return true; default: return false; } } internal static bool IsSymmetricAlgorithm(string algorithm) { switch (algorithm) { case SecurityAlgorithms.HmacSha1Signature: case SecurityAlgorithms.HmacSha256Signature: case SecurityAlgorithms.Aes128Encryption: case SecurityAlgorithms.Aes192Encryption: case SecurityAlgorithms.Aes256Encryption: case SecurityAlgorithms.TripleDesEncryption: case SecurityAlgorithms.Aes128KeyWrap: case SecurityAlgorithms.Aes192KeyWrap: case SecurityAlgorithms.Aes256KeyWrap: case SecurityAlgorithms.TripleDesKeyWrap: case SecurityAlgorithms.Psha1KeyDerivation: case SecurityAlgorithms.Psha1KeyDerivationDec2005: return true; default: return false; } } } } // 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
- CharEntityEncoderFallback.cs
- GCHandleCookieTable.cs
- BigInt.cs
- SafeHGlobalHandleCritical.cs
- RecordManager.cs
- HttpCachePolicyElement.cs
- DBSqlParser.cs
- PropertyChangedEventArgs.cs
- FontSourceCollection.cs
- ChangePassword.cs
- SqlConnectionString.cs
- ConstructorExpr.cs
- CompensatableTransactionScopeActivityDesigner.cs
- XamlWriterExtensions.cs
- IndicFontClient.cs
- Message.cs
- EventLogEntryCollection.cs
- IntSecurity.cs
- UserControl.cs
- MetadataItemCollectionFactory.cs
- DynamicHyperLink.cs
- OdbcConnection.cs
- SqlOuterApplyReducer.cs
- SEHException.cs
- CheckBoxList.cs
- Frame.cs
- IntegrationExceptionEventArgs.cs
- X509Certificate.cs
- _NegoStream.cs
- WindowsFont.cs
- DrawingAttributesDefaultValueFactory.cs
- XmlAttributeAttribute.cs
- MediaTimeline.cs
- ProfessionalColorTable.cs
- XamlParser.cs
- QueryReaderSettings.cs
- EmptyQuery.cs
- TimerEventSubscriptionCollection.cs
- FilteredAttributeCollection.cs
- CounterSample.cs
- PolyLineSegment.cs
- OleDbEnumerator.cs
- CommonGetThemePartSize.cs
- SessionPageStateSection.cs
- ClientTargetSection.cs
- UrlEncodedParameterWriter.cs
- ControlParameter.cs
- AppSettingsSection.cs
- XmlWriter.cs
- EntityDesignerBuildProvider.cs
- PartBasedPackageProperties.cs
- TaiwanLunisolarCalendar.cs
- JsonObjectDataContract.cs
- SoapMessage.cs
- SharedDp.cs
- BaseResourcesBuildProvider.cs
- PatternMatcher.cs
- Focus.cs
- UpdatePanelTriggerCollection.cs
- LogReserveAndAppendState.cs
- DocumentSequence.cs
- FreezableDefaultValueFactory.cs
- _ConnectOverlappedAsyncResult.cs
- TextEffectCollection.cs
- DynamicMetaObject.cs
- OuterGlowBitmapEffect.cs
- Rotation3D.cs
- ConfigXmlText.cs
- ObjectKeyFrameCollection.cs
- RootBuilder.cs
- HtmlInputHidden.cs
- SecurityRuntime.cs
- odbcmetadatafactory.cs
- RegionIterator.cs
- BoundField.cs
- WorkflowTraceTransfer.cs
- TypeNameConverter.cs
- XamlSerializerUtil.cs
- TabControlAutomationPeer.cs
- PropertyOrder.cs
- ContentHostHelper.cs
- InputScopeAttribute.cs
- MergeFilterQuery.cs
- DataSourceControlBuilder.cs
- InputReportEventArgs.cs
- DocumentOrderQuery.cs
- MemberAccessException.cs
- FeatureAttribute.cs
- RadioButtonPopupAdapter.cs
- ThreadStateException.cs
- PolicyAssertionCollection.cs
- SmiXetterAccessMap.cs
- VersionedStreamOwner.cs
- UnsafeNativeMethods.cs
- RenameRuleObjectDialog.cs
- PeerNameResolver.cs
- TextEffectResolver.cs
- SHA384CryptoServiceProvider.cs
- SolidBrush.cs
- DeviceContext.cs