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
- XPathExpr.cs
- ColumnBinding.cs
- ReflectionServiceProvider.cs
- DependencyObjectValidator.cs
- WebSysDescriptionAttribute.cs
- SingleAnimationBase.cs
- BeginEvent.cs
- UriTemplateClientFormatter.cs
- InvalidDataException.cs
- MessageSecurityOverTcpElement.cs
- PaperSize.cs
- QilXmlReader.cs
- HandlerFactoryWrapper.cs
- ProcessModule.cs
- CodeLinePragma.cs
- WebServiceHost.cs
- ExpressionVisitor.cs
- XsdBuilder.cs
- TargetConverter.cs
- StyleModeStack.cs
- InputLanguage.cs
- LocalClientSecuritySettings.cs
- OdbcConnection.cs
- CompositeScriptReference.cs
- PreviewControlDesigner.cs
- AnimationException.cs
- SingleTagSectionHandler.cs
- SQLCharsStorage.cs
- KnownColorTable.cs
- ColumnCollection.cs
- NavigatorOutput.cs
- SqlDataSourceSelectingEventArgs.cs
- HttpWebRequestElement.cs
- DrawingState.cs
- ListControl.cs
- SingleKeyFrameCollection.cs
- DrawToolTipEventArgs.cs
- AssociationTypeEmitter.cs
- BinaryUtilClasses.cs
- DeviceContexts.cs
- X509Certificate2Collection.cs
- DrawListViewSubItemEventArgs.cs
- ClientRuntimeConfig.cs
- WorkflowDebuggerSteppingAttribute.cs
- PersistChildrenAttribute.cs
- ImageMap.cs
- panel.cs
- RegexInterpreter.cs
- EpmContentSerializerBase.cs
- safesecurityhelperavalon.cs
- DelegatingTypeDescriptionProvider.cs
- DbExpressionVisitor_TResultType.cs
- ActivationService.cs
- WebPartCollection.cs
- DetailsViewPageEventArgs.cs
- Random.cs
- PropertyRecord.cs
- LiteralControl.cs
- SystemWebSectionGroup.cs
- PropertyChangedEventArgs.cs
- MethodBody.cs
- StylusButtonCollection.cs
- ToolStripPanelRow.cs
- SqlCommandBuilder.cs
- PageSettings.cs
- DocumentApplicationState.cs
- IdnElement.cs
- GACIdentityPermission.cs
- ServiceReference.cs
- DesignTimeSiteMapProvider.cs
- EllipticalNodeOperations.cs
- DefaultPropertiesToSend.cs
- DataGridViewCellStyleChangedEventArgs.cs
- KeyNotFoundException.cs
- CompilerErrorCollection.cs
- NotifyIcon.cs
- AutoGeneratedField.cs
- Rotation3DAnimation.cs
- BasicCellRelation.cs
- MemoryMappedFile.cs
- GroupBoxRenderer.cs
- ContractComponent.cs
- TypeConverterHelper.cs
- GlobalEventManager.cs
- VerticalAlignConverter.cs
- XomlCompilerResults.cs
- CompiledRegexRunner.cs
- DataFormats.cs
- ConnectionPool.cs
- ToolStripProgressBar.cs
- TreeView.cs
- IdnMapping.cs
- SystemFonts.cs
- ReflectionTypeLoadException.cs
- TypefaceMetricsCache.cs
- NameNode.cs
- DLinqColumnProvider.cs
- ItemType.cs
- Int32AnimationUsingKeyFrames.cs
- Helper.cs