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
- ArrayElementGridEntry.cs
- EncodingInfo.cs
- DesignerHost.cs
- FrameworkObject.cs
- UnmanagedMemoryStream.cs
- AssemblyName.cs
- XmlDomTextWriter.cs
- elementinformation.cs
- ProviderCollection.cs
- ColumnTypeConverter.cs
- GiveFeedbackEvent.cs
- ToolStripItemRenderEventArgs.cs
- Comparer.cs
- Switch.cs
- SignalGate.cs
- RubberbandSelector.cs
- OleDbRowUpdatingEvent.cs
- TreeNodeStyle.cs
- MemoryPressure.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- TextSpanModifier.cs
- SqlExpander.cs
- HashHelper.cs
- NamedPermissionSet.cs
- AccessDataSource.cs
- WmlTextBoxAdapter.cs
- ColorConvertedBitmap.cs
- FileSystemWatcher.cs
- MatrixTransform.cs
- PeerCustomResolverElement.cs
- HttpPostLocalhostServerProtocol.cs
- DbConvert.cs
- DataViewSettingCollection.cs
- NavigateEvent.cs
- returneventsaver.cs
- SecurityAlgorithmSuite.cs
- SmiConnection.cs
- ADMembershipUser.cs
- ObjectAnimationUsingKeyFrames.cs
- NameValuePair.cs
- UnaryExpressionHelper.cs
- VideoDrawing.cs
- UserNamePasswordValidationMode.cs
- IteratorFilter.cs
- RSAPKCS1SignatureDeformatter.cs
- CqlParserHelpers.cs
- OracleBoolean.cs
- ObjectConverter.cs
- KeyToListMap.cs
- CqlParserHelpers.cs
- TakeOrSkipWhileQueryOperator.cs
- OracleSqlParser.cs
- EditorPartDesigner.cs
- ImageConverter.cs
- DateTimeFormat.cs
- WebReferencesBuildProvider.cs
- StringSorter.cs
- OleDbStruct.cs
- UIHelper.cs
- EpmSyndicationContentSerializer.cs
- ToolStripLocationCancelEventArgs.cs
- SerializationUtility.cs
- RefreshEventArgs.cs
- SymDocumentType.cs
- BitmapEffectCollection.cs
- KnownTypes.cs
- VerificationAttribute.cs
- ScriptingSectionGroup.cs
- LocalizedNameDescriptionPair.cs
- AddressHeader.cs
- DecimalAnimation.cs
- SqlCacheDependencyDatabaseCollection.cs
- InkCanvasInnerCanvas.cs
- ReceiveMessageContent.cs
- ResourceIDHelper.cs
- RecipientIdentity.cs
- ToolbarAUtomationPeer.cs
- Vector3D.cs
- SupportsEventValidationAttribute.cs
- ColumnMapCopier.cs
- MTConfigUtil.cs
- FlowDocumentPage.cs
- LinkedResourceCollection.cs
- Vector3DIndependentAnimationStorage.cs
- CompilationRelaxations.cs
- ConnectionInterfaceCollection.cs
- Hashtable.cs
- TransportBindingElement.cs
- SmtpNegotiateAuthenticationModule.cs
- UnhandledExceptionEventArgs.cs
- FastEncoder.cs
- DebuggerAttributes.cs
- SessionIDManager.cs
- XNodeNavigator.cs
- ListViewDeleteEventArgs.cs
- CheckBox.cs
- AppSettingsReader.cs
- DataFormats.cs
- AbstractSvcMapFileLoader.cs
- PersonalizableAttribute.cs