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
- Vector.cs
- IndexedDataBuffer.cs
- ScrollPattern.cs
- ScriptModule.cs
- EnumMemberAttribute.cs
- FormatControl.cs
- ButtonChrome.cs
- StateManagedCollection.cs
- SyntaxCheck.cs
- TableCellAutomationPeer.cs
- HttpPostClientProtocol.cs
- MetaModel.cs
- KeyGesture.cs
- MessageSecurityOverMsmqElement.cs
- WhiteSpaceTrimStringConverter.cs
- Tablet.cs
- DomNameTable.cs
- BmpBitmapEncoder.cs
- ToolStripPanel.cs
- VisualTarget.cs
- DefaultIfEmptyQueryOperator.cs
- ExpressionEditorAttribute.cs
- UserUseLicenseDictionaryLoader.cs
- KeyInfo.cs
- SmtpException.cs
- WorkflowServiceBehavior.cs
- TypeUtil.cs
- ChameleonKey.cs
- DateTimeFormat.cs
- WinCategoryAttribute.cs
- RecordsAffectedEventArgs.cs
- IpcPort.cs
- MulticastOption.cs
- LogConverter.cs
- CodeAccessSecurityEngine.cs
- FileDialog.cs
- COM2Enum.cs
- InputChannelAcceptor.cs
- XmlSchemaNotation.cs
- InputLangChangeRequestEvent.cs
- NativeCppClassAttribute.cs
- LabelInfo.cs
- ForEachDesigner.xaml.cs
- WsatProxy.cs
- RelationshipWrapper.cs
- DTCTransactionManager.cs
- PrinterUnitConvert.cs
- NavigationService.cs
- DiscreteKeyFrames.cs
- ColorContextHelper.cs
- RestHandlerFactory.cs
- XmlSigningNodeWriter.cs
- ConnectorSelectionGlyph.cs
- ClientRoleProvider.cs
- DbConnectionPool.cs
- ClickablePoint.cs
- TransformGroup.cs
- ExpressionBuilder.cs
- Setter.cs
- ReadOnlyTernaryTree.cs
- DeferredSelectedIndexReference.cs
- RtfToken.cs
- Debug.cs
- Error.cs
- ClientType.cs
- WorkflowDebuggerSteppingAttribute.cs
- KnowledgeBase.cs
- SemaphoreSecurity.cs
- CompilerScope.cs
- ConvertBinder.cs
- DescendantQuery.cs
- _SslState.cs
- NavigationProgressEventArgs.cs
- PagerSettings.cs
- QueryContinueDragEvent.cs
- IndexingContentUnit.cs
- TypeConverterHelper.cs
- MembershipValidatePasswordEventArgs.cs
- SendKeys.cs
- GeometryHitTestParameters.cs
- LongValidator.cs
- XmlCDATASection.cs
- LogicalExpressionEditor.cs
- ConditionalAttribute.cs
- SqlBulkCopyColumnMappingCollection.cs
- ProtectedConfiguration.cs
- BulletedListEventArgs.cs
- XmlHelper.cs
- XamlBrushSerializer.cs
- HandlerMappingMemo.cs
- HierarchicalDataBoundControl.cs
- UserControlCodeDomTreeGenerator.cs
- odbcmetadatacolumnnames.cs
- WorkflowLayouts.cs
- CheckBoxField.cs
- EmptyReadOnlyDictionaryInternal.cs
- EnumValAlphaComparer.cs
- _ConnectionGroup.cs
- WindowVisualStateTracker.cs
- ConsoleEntryPoint.cs