Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Security / Cryptography / SignatureDescription.cs / 1 / SignatureDescription.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // SignatureDescription.cs // namespace System.Security.Cryptography { using System.Security.Util; [System.Runtime.InteropServices.ComVisible(true)] public class SignatureDescription { private String _strKey; private String _strDigest; private String _strFormatter; private String _strDeformatter; // // public constructors // public SignatureDescription() { } public SignatureDescription(SecurityElement el) { if (el == null) throw new ArgumentNullException("el"); _strKey = el.SearchForTextOfTag("Key"); _strDigest = el.SearchForTextOfTag("Digest"); _strFormatter = el.SearchForTextOfTag("Formatter"); _strDeformatter = el.SearchForTextOfTag("Deformatter"); } // // property methods // public String KeyAlgorithm { get { return _strKey; } set { _strKey = value; } } public String DigestAlgorithm { get { return _strDigest; } set { _strDigest = value; } } public String FormatterAlgorithm { get { return _strFormatter; } set { _strFormatter = value; } } public String DeformatterAlgorithm { get {return _strDeformatter; } set {_strDeformatter = value; } } // // public methods // public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key) { AsymmetricSignatureDeformatter item; item = (AsymmetricSignatureDeformatter) CryptoConfig.CreateFromName(_strDeformatter); item.SetKey(key); return item; } public virtual AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key) { AsymmetricSignatureFormatter item; item = (AsymmetricSignatureFormatter) CryptoConfig.CreateFromName(_strFormatter); item.SetKey(key); return item; } public virtual HashAlgorithm CreateDigest() { return (HashAlgorithm) CryptoConfig.CreateFromName(_strDigest); } } internal class RSAPKCS1SHA1SignatureDescription : SignatureDescription { public RSAPKCS1SHA1SignatureDescription() { KeyAlgorithm = "System.Security.Cryptography.RSACryptoServiceProvider"; DigestAlgorithm = "System.Security.Cryptography.SHA1CryptoServiceProvider"; FormatterAlgorithm = "System.Security.Cryptography.RSAPKCS1SignatureFormatter"; DeformatterAlgorithm = "System.Security.Cryptography.RSAPKCS1SignatureDeformatter"; } public override AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key) { AsymmetricSignatureDeformatter item = (AsymmetricSignatureDeformatter) CryptoConfig.CreateFromName(DeformatterAlgorithm); item.SetKey(key); item.SetHashAlgorithm("SHA1"); return item; } } internal class DSASignatureDescription : SignatureDescription { public DSASignatureDescription() { KeyAlgorithm = "System.Security.Cryptography.DSACryptoServiceProvider"; DigestAlgorithm = "System.Security.Cryptography.SHA1CryptoServiceProvider"; FormatterAlgorithm = "System.Security.Cryptography.DSASignatureFormatter"; DeformatterAlgorithm = "System.Security.Cryptography.DSASignatureDeformatter"; } } } // 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
- EastAsianLunisolarCalendar.cs
- StringAnimationUsingKeyFrames.cs
- ImageInfo.cs
- URL.cs
- HttpWrapper.cs
- _DomainName.cs
- ResourceDescriptionAttribute.cs
- MinimizableAttributeTypeConverter.cs
- Membership.cs
- RawStylusInputCustomDataList.cs
- DynamicQueryableWrapper.cs
- WorkflowOperationErrorHandler.cs
- DataListItemCollection.cs
- ScriptingProfileServiceSection.cs
- ExpressionPrefixAttribute.cs
- PolyQuadraticBezierSegment.cs
- EllipseGeometry.cs
- PropertySegmentSerializationProvider.cs
- ColumnTypeConverter.cs
- TickBar.cs
- HttpContext.cs
- CatalogZoneDesigner.cs
- PropertyDescriptorCollection.cs
- ExitEventArgs.cs
- ConnectionPointGlyph.cs
- DataSourceCache.cs
- ListCollectionView.cs
- ModelPropertyImpl.cs
- SchemaRegistration.cs
- SoapEnumAttribute.cs
- DefaultBinder.cs
- HttpModuleAction.cs
- Propagator.cs
- WebPageTraceListener.cs
- SqlNotificationRequest.cs
- OutputCacheModule.cs
- UrlPath.cs
- WebServiceTypeData.cs
- Link.cs
- GradientStopCollection.cs
- TransformGroup.cs
- FixedSOMLineRanges.cs
- SHA384.cs
- DataBindingHandlerAttribute.cs
- CommentEmitter.cs
- TextFormattingConverter.cs
- CompressedStack.cs
- InvalidDataContractException.cs
- XmlSchemaGroup.cs
- EntitySqlQueryCacheKey.cs
- SpotLight.cs
- SelectionPatternIdentifiers.cs
- UiaCoreProviderApi.cs
- RoamingStoreFileUtility.cs
- DocumentViewerAutomationPeer.cs
- RawStylusInput.cs
- MemoryMappedFile.cs
- RC2CryptoServiceProvider.cs
- CommandValueSerializer.cs
- VisualTreeUtils.cs
- Inflater.cs
- UIElement.cs
- AlignmentYValidation.cs
- XmlSchemaGroup.cs
- AccessControlList.cs
- SqlClientPermission.cs
- SmtpFailedRecipientsException.cs
- _TimerThread.cs
- MiniCustomAttributeInfo.cs
- TTSVoice.cs
- DataTableCollection.cs
- UTF7Encoding.cs
- StringExpressionSet.cs
- PropertyEntry.cs
- MasterPage.cs
- PageCatalogPart.cs
- FontDialog.cs
- Pair.cs
- AssemblyCache.cs
- MtomMessageEncoder.cs
- _SpnDictionary.cs
- PageTheme.cs
- TabControlAutomationPeer.cs
- PreDigestedSignedInfo.cs
- ValidationHelper.cs
- PropertyInfoSet.cs
- FrameworkEventSource.cs
- NameNode.cs
- HyperLinkField.cs
- TextDpi.cs
- AttributeAction.cs
- MessageHeaders.cs
- PowerModeChangedEventArgs.cs
- DataGridViewDataErrorEventArgs.cs
- BindingSourceDesigner.cs
- UsernameTokenFactoryCredential.cs
- DirectoryInfo.cs
- ProgressBarBrushConverter.cs
- _ShellExpression.cs
- Config.cs