Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / clr / src / BCL / System / Security / Cryptography / PKCS1MaskGenerationMethod.cs / 1 / PKCS1MaskGenerationMethod.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class PKCS1MaskGenerationMethod : MaskGenerationMethod { private String HashNameValue; // // public constructors // public PKCS1MaskGenerationMethod() { HashNameValue = "SHA1"; } // // public properties // public String HashName { get { return HashNameValue; } set { HashNameValue = value; if (HashNameValue == null) { HashNameValue = "SHA1"; } } } // // public methods // public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn) { HashAlgorithm hash = (HashAlgorithm) CryptoConfig.CreateFromName(HashNameValue); byte[] rgbCounter = new byte[4]; byte[] rgbT = new byte[cbReturn]; uint counter = 0; for (int ib=0; ib_hash.Length) { Buffer.BlockCopy(_hash, 0, rgbT, ib, _hash.Length); } else { Buffer.BlockCopy(_hash, 0, rgbT, ib, rgbT.Length - ib); } ib += hash.Hash.Length; } return rgbT; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public class PKCS1MaskGenerationMethod : MaskGenerationMethod { private String HashNameValue; // // public constructors // public PKCS1MaskGenerationMethod() { HashNameValue = "SHA1"; } // // public properties // public String HashName { get { return HashNameValue; } set { HashNameValue = value; if (HashNameValue == null) { HashNameValue = "SHA1"; } } } // // public methods // public override byte[] GenerateMask(byte[] rgbSeed, int cbReturn) { HashAlgorithm hash = (HashAlgorithm) CryptoConfig.CreateFromName(HashNameValue); byte[] rgbCounter = new byte[4]; byte[] rgbT = new byte[cbReturn]; uint counter = 0; for (int ib=0; ib _hash.Length) { Buffer.BlockCopy(_hash, 0, rgbT, ib, _hash.Length); } else { Buffer.BlockCopy(_hash, 0, rgbT, ib, rgbT.Length - ib); } ib += hash.Hash.Length; } return rgbT; } } } // 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
- GeneralTransform2DTo3DTo2D.cs
- RsaSecurityToken.cs
- PasswordDeriveBytes.cs
- XamlTypeMapper.cs
- RequestCacheEntry.cs
- ResourcePermissionBaseEntry.cs
- recordstatescratchpad.cs
- ZipIOLocalFileHeader.cs
- AmbientLight.cs
- WebPartEditorCancelVerb.cs
- DataServiceResponse.cs
- EndpointAddress.cs
- CodeTryCatchFinallyStatement.cs
- ListBindingConverter.cs
- CompilationRelaxations.cs
- PageSettings.cs
- FontConverter.cs
- Matrix3D.cs
- StylusButtonEventArgs.cs
- TextDecorations.cs
- DesignerHierarchicalDataSourceView.cs
- NativeMethods.cs
- SubclassTypeValidator.cs
- XmlAnyElementAttribute.cs
- TreeNodeEventArgs.cs
- PointConverter.cs
- _RequestCacheProtocol.cs
- SkinBuilder.cs
- HandlerMappingMemo.cs
- RefreshEventArgs.cs
- SectionVisual.cs
- DataMisalignedException.cs
- StandardTransformFactory.cs
- UnionExpr.cs
- PartitionedDataSource.cs
- HyperLink.cs
- FixedSOMTable.cs
- DelimitedListTraceListener.cs
- XmlTextReader.cs
- ConfigXmlSignificantWhitespace.cs
- ReaderContextStackData.cs
- HandlerWithFactory.cs
- CodeThrowExceptionStatement.cs
- Win32.cs
- IgnoreSectionHandler.cs
- ControllableStoryboardAction.cs
- InstancePersistenceCommand.cs
- DefaultValueTypeConverter.cs
- DictionaryItemsCollection.cs
- SelectionHighlightInfo.cs
- BehaviorEditorPart.cs
- StateMachine.cs
- IdentityManager.cs
- CellIdBoolean.cs
- GeometryConverter.cs
- DictionaryMarkupSerializer.cs
- DbConnectionPoolIdentity.cs
- RequestCachePolicy.cs
- UrlMappingsModule.cs
- ReachNamespaceInfo.cs
- DataErrorValidationRule.cs
- MetadataSerializer.cs
- CollectionViewProxy.cs
- NameNode.cs
- BitmapEffect.cs
- PhysicalOps.cs
- CacheMemory.cs
- CustomErrorsSectionWrapper.cs
- FirewallWrapper.cs
- MetaDataInfo.cs
- Attributes.cs
- SqlDataSourceStatusEventArgs.cs
- FullTextLine.cs
- TagNameToTypeMapper.cs
- ProtocolsConfiguration.cs
- HandlerBase.cs
- DataGridViewControlCollection.cs
- JavaScriptObjectDeserializer.cs
- TemplateBamlRecordReader.cs
- ScriptReference.cs
- safex509handles.cs
- CryptoSession.cs
- ProfileEventArgs.cs
- SliderAutomationPeer.cs
- CollectionConverter.cs
- InternalBase.cs
- DetailsViewPageEventArgs.cs
- DBBindings.cs
- Facet.cs
- XmlEncApr2001.cs
- GradientBrush.cs
- DrawingGroup.cs
- XmlILConstructAnalyzer.cs
- AspProxy.cs
- PrimitiveCodeDomSerializer.cs
- AnnotationResourceCollection.cs
- AliasGenerator.cs
- MasterPageParser.cs
- QuotedPrintableStream.cs
- ContainerSelectorGlyph.cs