Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- OdbcFactory.cs
- DetailsViewRow.cs
- ImageMap.cs
- OleDbCommandBuilder.cs
- SpoolingTaskBase.cs
- DataControlButton.cs
- Random.cs
- DecimalAnimation.cs
- CriticalHandle.cs
- Axis.cs
- DoubleConverter.cs
- PolicyChain.cs
- ScrollViewerAutomationPeer.cs
- StateWorkerRequest.cs
- ReferencedType.cs
- OSFeature.cs
- XPathScanner.cs
- TabletCollection.cs
- ObjectDataSourceMethodEventArgs.cs
- DrawingState.cs
- ObjectListComponentEditor.cs
- DispatcherObject.cs
- WSSecurityOneDotOneSendSecurityHeader.cs
- TypeLoadException.cs
- HttpsHostedTransportConfiguration.cs
- DEREncoding.cs
- SvcMapFile.cs
- HierarchicalDataBoundControl.cs
- VisualBrush.cs
- ResXResourceReader.cs
- XPathException.cs
- DbProviderFactories.cs
- _SecureChannel.cs
- ToolStripItemGlyph.cs
- DataListCommandEventArgs.cs
- GridItemProviderWrapper.cs
- DefaultShape.cs
- DataSourceCache.cs
- IteratorFilter.cs
- SQLDateTimeStorage.cs
- PropertyGridEditorPart.cs
- AnimationStorage.cs
- SiteMapDataSourceView.cs
- TextContainerHelper.cs
- DynamicQueryableWrapper.cs
- WMICapabilities.cs
- BindingExpression.cs
- SpeechEvent.cs
- HttpListenerRequestUriBuilder.cs
- StrokeDescriptor.cs
- Statements.cs
- QueryAsyncResult.cs
- FakeModelPropertyImpl.cs
- ReaderContextStackData.cs
- PropertyChangedEventArgs.cs
- XComponentModel.cs
- _SecureChannel.cs
- PropertyRecord.cs
- Size.cs
- FileLogRecordEnumerator.cs
- ResourceContainer.cs
- BadImageFormatException.cs
- SymDocumentType.cs
- Fault.cs
- ProviderUtil.cs
- TextParaLineResult.cs
- ReferenceSchema.cs
- TimeZone.cs
- ServerType.cs
- XmlAttributeAttribute.cs
- Preprocessor.cs
- BindingContext.cs
- LayoutInformation.cs
- XmlNodeChangedEventManager.cs
- ComEventsMethod.cs
- TypeDelegator.cs
- Helpers.cs
- ContextMenu.cs
- MachineKeySection.cs
- MetadataCache.cs
- PopupRoot.cs
- MultiView.cs
- EncodingFallbackAwareXmlTextWriter.cs
- CustomErrorsSectionWrapper.cs
- rsa.cs
- ToolStripDropDown.cs
- GridSplitter.cs
- SmtpDigestAuthenticationModule.cs
- ChannelEndpointElement.cs
- TabControlCancelEvent.cs
- Image.cs
- AliasedSlot.cs
- SoapSchemaImporter.cs
- ServerIdentity.cs
- FileEnumerator.cs
- XsdSchemaFileEditor.cs
- StringOutput.cs
- DesignerFrame.cs
- XslAstAnalyzer.cs
- WebSysDefaultValueAttribute.cs