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
- DataContractSerializer.cs
- TableAdapterManagerGenerator.cs
- DbParameterCollectionHelper.cs
- ModifiableIteratorCollection.cs
- Vector3D.cs
- GridErrorDlg.cs
- DSASignatureDeformatter.cs
- XPathNodePointer.cs
- RegexCompiler.cs
- EnumUnknown.cs
- TdsParserStateObject.cs
- BinaryFormatter.cs
- PeerNameRecordCollection.cs
- DecoderNLS.cs
- CodeTypeDeclaration.cs
- AggregationMinMaxHelpers.cs
- ListManagerBindingsCollection.cs
- SQLSingle.cs
- HttpPostedFile.cs
- PackUriHelper.cs
- SpellerStatusTable.cs
- FormViewCommandEventArgs.cs
- RectangleGeometry.cs
- ValidationResults.cs
- SignatureGenerator.cs
- WebServiceBindingAttribute.cs
- WinEventWrap.cs
- DetailsViewUpdateEventArgs.cs
- RotateTransform.cs
- EnvelopedSignatureTransform.cs
- AuthenticationConfig.cs
- X509SecurityToken.cs
- MenuStrip.cs
- VariableReference.cs
- ConfigXmlAttribute.cs
- MergePropertyDescriptor.cs
- Policy.cs
- Command.cs
- OdbcEnvironment.cs
- Component.cs
- Boolean.cs
- SoapAttributeOverrides.cs
- PhysicalFontFamily.cs
- Zone.cs
- CompositionAdorner.cs
- NavigationProperty.cs
- ResolveResponseInfo.cs
- ConcatQueryOperator.cs
- MSAAEventDispatcher.cs
- RoutedEventHandlerInfo.cs
- XmlSchemaElement.cs
- CodeDefaultValueExpression.cs
- Point4D.cs
- adornercollection.cs
- SchemaObjectWriter.cs
- SqlBooleanMismatchVisitor.cs
- IDictionary.cs
- TableLayoutPanelBehavior.cs
- AsymmetricAlgorithm.cs
- documentation.cs
- DataMember.cs
- X509Chain.cs
- GeneralTransform3D.cs
- SmtpFailedRecipientException.cs
- ScrollContentPresenter.cs
- SchemaTableColumn.cs
- DataRecordObjectView.cs
- Journaling.cs
- AppSecurityManager.cs
- CacheSection.cs
- Completion.cs
- PopOutPanel.cs
- TransformerInfo.cs
- RewritingSimplifier.cs
- VisemeEventArgs.cs
- AuthenticationService.cs
- AccessViolationException.cs
- ProjectionCamera.cs
- WmlValidationSummaryAdapter.cs
- Rss20FeedFormatter.cs
- BoolLiteral.cs
- VisualStyleInformation.cs
- SectionUpdates.cs
- BulletedList.cs
- HatchBrush.cs
- JsonClassDataContract.cs
- XLinq.cs
- WebPartCloseVerb.cs
- IconConverter.cs
- DataSourceControlBuilder.cs
- ObjectDataSourceView.cs
- querybuilder.cs
- ReferentialConstraintRoleElement.cs
- GlobalEventManager.cs
- TreeNodeMouseHoverEvent.cs
- GridViewDesigner.cs
- Icon.cs
- XsltSettings.cs
- SQLInt32Storage.cs
- HelloOperation11AsyncResult.cs