Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Security / Cryptography / MD5CryptoServiceProvider.cs / 1 / MD5CryptoServiceProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // // MD5CryptoServiceProvider.cs // namespace System.Security.Cryptography { [System.Runtime.InteropServices.ComVisible(true)] public sealed class MD5CryptoServiceProvider : MD5 { private SafeHashHandle _safeHashHandle = null; // // public constructors // public MD5CryptoServiceProvider() { if (Utils.FipsAlgorithmPolicy == 1) throw new InvalidOperationException(Environment.GetResourceString("Cryptography_NonCompliantFIPSAlgorithm")); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void Dispose(bool disposing) { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); base.Dispose(disposing); } // // public methods // public override void Initialize() { if (_safeHashHandle != null && !_safeHashHandle.IsClosed) _safeHashHandle.Dispose(); SafeHashHandle safeHashHandle = SafeHashHandle.InvalidHandle; // _CreateHash will check for failures and throw the appropriate exception Utils._CreateHash(Utils.StaticProvHandle, Constants.CALG_MD5, ref safeHashHandle); _safeHashHandle = safeHashHandle; } protected override void HashCore(byte[] rgb, int ibStart, int cbSize) { Utils._HashData(_safeHashHandle, rgb, ibStart, cbSize); } protected override byte[] HashFinal() { return Utils._EndHash(_safeHashHandle); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XNodeNavigator.cs
- ElementHost.cs
- LineMetrics.cs
- InstanceDataCollection.cs
- GcHandle.cs
- DesignerAttribute.cs
- SHA384Cng.cs
- CallContext.cs
- RelationshipSet.cs
- SizeConverter.cs
- HealthMonitoringSection.cs
- TableCellAutomationPeer.cs
- OleDbPermission.cs
- EntityViewContainer.cs
- GlobalizationSection.cs
- OdbcException.cs
- WebColorConverter.cs
- Dispatcher.cs
- SystemParameters.cs
- XamlGridLengthSerializer.cs
- OwnerDrawPropertyBag.cs
- RijndaelManaged.cs
- GridViewRowEventArgs.cs
- ContainerSelectorActiveEvent.cs
- BuildProvidersCompiler.cs
- SessionStateItemCollection.cs
- UriSectionReader.cs
- Frame.cs
- PolicyStatement.cs
- DefaultObjectMappingItemCollection.cs
- EdmToObjectNamespaceMap.cs
- GenericTypeParameterBuilder.cs
- TimeIntervalCollection.cs
- BindingOperations.cs
- OdbcErrorCollection.cs
- Screen.cs
- ObjectAssociationEndMapping.cs
- XmlNodeReader.cs
- MulticastOption.cs
- SineEase.cs
- ExceptionAggregator.cs
- SystemKeyConverter.cs
- ConnectionPoint.cs
- TextEvent.cs
- SqlConnectionStringBuilder.cs
- PackageRelationshipCollection.cs
- TransactionScope.cs
- KeysConverter.cs
- NotifyIcon.cs
- dbdatarecord.cs
- AxHostDesigner.cs
- TransformerInfoCollection.cs
- XmlWrappingReader.cs
- NetPipeSection.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ContentType.cs
- CriticalHandle.cs
- ImageFormatConverter.cs
- RoleManagerEventArgs.cs
- OleDbWrapper.cs
- SmtpFailedRecipientsException.cs
- mediaeventargs.cs
- RawUIStateInputReport.cs
- EntitySqlQueryCacheEntry.cs
- HtmlInputButton.cs
- AssociationSet.cs
- RawStylusInputReport.cs
- WorkflowWebService.cs
- SurrogateChar.cs
- MexTcpBindingElement.cs
- TraceSection.cs
- XsltQilFactory.cs
- Material.cs
- FaultContractAttribute.cs
- SortKey.cs
- HttpRequestTraceRecord.cs
- FolderBrowserDialogDesigner.cs
- XmlQueryType.cs
- FormsAuthenticationEventArgs.cs
- XmlSerializerAssemblyAttribute.cs
- SqlBulkCopyColumnMapping.cs
- ListViewUpdatedEventArgs.cs
- LingerOption.cs
- TextEncodedRawTextWriter.cs
- TargetInvocationException.cs
- Maps.cs
- WebPartActionVerb.cs
- StorageInfo.cs
- CollectionType.cs
- ObjectSecurity.cs
- DragStartedEventArgs.cs
- AuthenticationException.cs
- DefaultValidator.cs
- PrintDialog.cs
- NativeCppClassAttribute.cs
- TabItemAutomationPeer.cs
- ProjectionPruner.cs
- CodeTypeReferenceExpression.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- InternalConfigSettingsFactory.cs