Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / SignatureDescription.cs / 1305376 / SignatureDescription.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //[....] // // // SignatureDescription.cs // namespace System.Security.Cryptography { using System.Security.Util; using System.Diagnostics.Contracts; [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"); Contract.EndContractBlock(); _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 // [System.Security.SecuritySafeCritical] // auto-generated public virtual AsymmetricSignatureDeformatter CreateDeformatter(AsymmetricAlgorithm key) { AsymmetricSignatureDeformatter item; item = (AsymmetricSignatureDeformatter) CryptoConfig.CreateFromName(_strDeformatter); item.SetKey(key); return item; } [System.Security.SecuritySafeCritical] // auto-generated public virtual AsymmetricSignatureFormatter CreateFormatter(AsymmetricAlgorithm key) { AsymmetricSignatureFormatter item; item = (AsymmetricSignatureFormatter) CryptoConfig.CreateFromName(_strFormatter); item.SetKey(key); return item; } [System.Security.SecuritySafeCritical] // auto-generated 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NavigationExpr.cs
- ApplicationManager.cs
- XmlSchemaObject.cs
- TextEditorDragDrop.cs
- CallSiteBinder.cs
- FormViewCommandEventArgs.cs
- Track.cs
- Page.cs
- OletxDependentTransaction.cs
- SafeLibraryHandle.cs
- RectangleGeometry.cs
- SQLGuid.cs
- XmlName.cs
- AsyncDataRequest.cs
- Thickness.cs
- DetailsViewDeletedEventArgs.cs
- DispatchChannelSink.cs
- ServiceOperationListItemList.cs
- Scene3D.cs
- ActivityExecutionContextCollection.cs
- PartialCachingAttribute.cs
- MissingFieldException.cs
- TemplateControl.cs
- BitStream.cs
- OperandQuery.cs
- HierarchicalDataBoundControl.cs
- ShutDownListener.cs
- DeferrableContent.cs
- RawStylusInputCustomData.cs
- HandlerWithFactory.cs
- SimpleType.cs
- IdnElement.cs
- DataObject.cs
- StreamingContext.cs
- RectAnimationUsingKeyFrames.cs
- DirectoryObjectSecurity.cs
- Int16Animation.cs
- safesecurityhelperavalon.cs
- NetTcpSecurityElement.cs
- VisualBasicHelper.cs
- RightNameExpirationInfoPair.cs
- DateTimeFormatInfoScanner.cs
- ByteRangeDownloader.cs
- ContentFilePart.cs
- TimerEventSubscription.cs
- RequestCacheEntry.cs
- WebBrowserDocumentCompletedEventHandler.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- PassportAuthenticationModule.cs
- FlowDocumentPage.cs
- CategoryAttribute.cs
- BindingsCollection.cs
- DropDownButton.cs
- CodeStatementCollection.cs
- DataRowChangeEvent.cs
- BaseValidator.cs
- PreviewPrintController.cs
- CorruptingExceptionCommon.cs
- UnicodeEncoding.cs
- TraceFilter.cs
- KnownBoxes.cs
- RadioButton.cs
- ImageDrawing.cs
- XmlTypeMapping.cs
- DateTimeStorage.cs
- SrgsDocumentParser.cs
- SqlReferenceCollection.cs
- MachineSettingsSection.cs
- ToolStripDropTargetManager.cs
- XmlWriterSettings.cs
- Point3DCollection.cs
- ConfigurationManagerHelperFactory.cs
- AnnotationComponentChooser.cs
- Validator.cs
- SQLUtility.cs
- HMACRIPEMD160.cs
- xmlsaver.cs
- LabelInfo.cs
- MachineKeyValidationConverter.cs
- OdbcDataReader.cs
- PlatformNotSupportedException.cs
- BinaryParser.cs
- EntityCommandExecutionException.cs
- ExpressionConverter.cs
- EntityDataSourceDesignerHelper.cs
- ToolTipService.cs
- Html32TextWriter.cs
- SubtreeProcessor.cs
- RichTextBoxConstants.cs
- QilXmlWriter.cs
- ParallelTimeline.cs
- DataGridColumnsPage.cs
- CapabilitiesUse.cs
- Rfc2898DeriveBytes.cs
- DocumentOrderQuery.cs
- DocumentViewerConstants.cs
- TransactionManager.cs
- QfeChecker.cs
- SQLBoolean.cs
- DiscoveryDocumentSerializer.cs