Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Security / Cryptography / PKCS1MaskGenerationMethod.cs / 1305376 / 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 // [System.Security.SecuritySafeCritical] // auto-generated 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 // [System.Security.SecuritySafeCritical] // auto-generated 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
- SHA256CryptoServiceProvider.cs
- CardSpaceException.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- XmlDataProvider.cs
- CultureData.cs
- PresentationUIStyleResources.cs
- X509ChainPolicy.cs
- Keywords.cs
- DoubleCollection.cs
- OleDbRowUpdatedEvent.cs
- FeatureAttribute.cs
- SafeEventLogWriteHandle.cs
- UiaCoreProviderApi.cs
- SQLDecimalStorage.cs
- TextDpi.cs
- DocumentOrderQuery.cs
- SchemaMapping.cs
- ProcessModuleCollection.cs
- WebPartsSection.cs
- StartUpEventArgs.cs
- DecoderReplacementFallback.cs
- GeometryHitTestResult.cs
- ByteStreamGeometryContext.cs
- SingleObjectCollection.cs
- OracleColumn.cs
- FieldBuilder.cs
- DiffuseMaterial.cs
- UniqueConstraint.cs
- DesignerView.cs
- ProfileEventArgs.cs
- ContentValidator.cs
- GridViewRowCollection.cs
- SoapExtensionTypeElementCollection.cs
- TypeBuilder.cs
- WpfXamlType.cs
- MetadataCollection.cs
- HtmlSelectionListAdapter.cs
- DoubleLink.cs
- XmlDocumentFragment.cs
- ToolStripScrollButton.cs
- SignatureResourceHelper.cs
- SymbolMethod.cs
- ValidationError.cs
- BehaviorEditorPart.cs
- KeyToListMap.cs
- CollectionMarkupSerializer.cs
- XsdValidatingReader.cs
- SoapAttributeAttribute.cs
- Border.cs
- DataMember.cs
- DataBoundControlHelper.cs
- DockProviderWrapper.cs
- DataServiceConfiguration.cs
- GroupBox.cs
- DataFormats.cs
- Slider.cs
- QilInvoke.cs
- HttpConfigurationSystem.cs
- ClockGroup.cs
- TypeToken.cs
- DataPagerFieldCommandEventArgs.cs
- Privilege.cs
- DrawingImage.cs
- DynamicValidatorEventArgs.cs
- DeviceSpecific.cs
- Site.cs
- ModifierKeysValueSerializer.cs
- DrawingState.cs
- PeerNameResolver.cs
- followingquery.cs
- ChildTable.cs
- ErrorFormatterPage.cs
- BitmapPalettes.cs
- UTF8Encoding.cs
- ThreadSafeList.cs
- FlowLayoutSettings.cs
- DataGridViewBindingCompleteEventArgs.cs
- ServerIdentity.cs
- StringComparer.cs
- TiffBitmapEncoder.cs
- StandardTransformFactory.cs
- KnownTypeHelper.cs
- SqlStatistics.cs
- DataGridComboBoxColumn.cs
- UnaryNode.cs
- UpdateTranslator.cs
- StylusLogic.cs
- SystemInfo.cs
- EventLogEntry.cs
- Exceptions.cs
- NodeFunctions.cs
- ComboBoxAutomationPeer.cs
- RuntimeArgumentHandle.cs
- InvokeSchedule.cs
- ParserStreamGeometryContext.cs
- Nullable.cs
- ACL.cs
- SafeNativeMethods.cs
- CodeDomLoader.cs
- EntitySetBaseCollection.cs