Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- FileResponseElement.cs
- _DisconnectOverlappedAsyncResult.cs
- PermissionToken.cs
- Stroke.cs
- InputLanguageCollection.cs
- ProtocolsSection.cs
- EventLevel.cs
- DTCTransactionManager.cs
- _FixedSizeReader.cs
- DataGridViewRowHeaderCell.cs
- ColumnTypeConverter.cs
- CodeFieldReferenceExpression.cs
- LambdaCompiler.Expressions.cs
- loginstatus.cs
- RadioButtonList.cs
- AppSettingsSection.cs
- CardSpacePolicyElement.cs
- QueryExpr.cs
- DataGrid.cs
- DependentList.cs
- CollectionView.cs
- validationstate.cs
- OperatorExpressions.cs
- SchemaContext.cs
- XPathAncestorQuery.cs
- DataColumnMapping.cs
- RuleRef.cs
- SystemIPv4InterfaceProperties.cs
- SelectionItemPattern.cs
- HwndStylusInputProvider.cs
- XmlSchemaAttributeGroup.cs
- ControlValuePropertyAttribute.cs
- ResourcesGenerator.cs
- CapabilitiesRule.cs
- LinearGradientBrush.cs
- CFStream.cs
- DesignTimeTemplateParser.cs
- SmiContext.cs
- ReferentialConstraint.cs
- control.ime.cs
- ProjectionPruner.cs
- CacheHelper.cs
- ProcessHostConfigUtils.cs
- UserPreferenceChangingEventArgs.cs
- CompositeCollection.cs
- SimpleExpression.cs
- Ipv6Element.cs
- XmlName.cs
- SystemIcons.cs
- List.cs
- PageTheme.cs
- PathFigure.cs
- IndentedTextWriter.cs
- VisualBrush.cs
- StateItem.cs
- LinkButton.cs
- TraceHandler.cs
- ExpandSegment.cs
- RegexWriter.cs
- ElasticEase.cs
- AVElementHelper.cs
- FileVersionInfo.cs
- PageTheme.cs
- QuerySettings.cs
- OutputCacheSettings.cs
- FileDialog.cs
- FamilyTypeface.cs
- WebPartZone.cs
- DropShadowBitmapEffect.cs
- FixedHyperLink.cs
- TextPointerBase.cs
- SqlUserDefinedAggregateAttribute.cs
- WebPartDescriptionCollection.cs
- baseshape.cs
- ThreadInterruptedException.cs
- HtmlHead.cs
- TextStore.cs
- RepeaterItemCollection.cs
- DuplicateWaitObjectException.cs
- AQNBuilder.cs
- IndexerNameAttribute.cs
- TrimSurroundingWhitespaceAttribute.cs
- ObjectDisposedException.cs
- NodeLabelEditEvent.cs
- ProjectionCamera.cs
- XMLDiffLoader.cs
- SoapReflectionImporter.cs
- ConfigurationSectionGroupCollection.cs
- Deflater.cs
- TextViewSelectionProcessor.cs
- ListBoxChrome.cs
- MimeMapping.cs
- InputReportEventArgs.cs
- MSAANativeProvider.cs
- AppDomainAttributes.cs
- HScrollBar.cs
- InvalidComObjectException.cs
- InputLanguageProfileNotifySink.cs
- FamilyMapCollection.cs
- StrokeSerializer.cs