Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Security / Cryptography / SHA384CryptoServiceProvider.cs / 1305376 / SHA384CryptoServiceProvider.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ////// Wrapper around the CAPI implementation of the SHA-384 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA384CryptoServiceProvider : SHA384 { private CapiHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA384CryptoServiceProvider() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, CapiNative.ProviderType.RsaAes, CapiNative.AlgorithmId.Sha384); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } ///// /// Reset the hash algorithm to begin hashing a new set of data /// //// [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } ///// /// Hash a block of data /// //// [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } ///// /// Complete the hash, returning its value /// //// [System.Security.SecurityCritical] protected override byte[] HashFinal() { Contract.Assert(m_hashAlgorithm != null); return m_hashAlgorithm.HashFinal(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== using System; using System.Diagnostics.Contracts; namespace System.Security.Cryptography { ///// /// Wrapper around the CAPI implementation of the SHA-384 hashing algorithm /// [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class SHA384CryptoServiceProvider : SHA384 { private CapiHashAlgorithm m_hashAlgorithm; //// [System.Security.SecurityCritical] public SHA384CryptoServiceProvider() { Contract.Ensures(m_hashAlgorithm != null); m_hashAlgorithm = new CapiHashAlgorithm(CapiNative.ProviderNames.MicrosoftEnhancedRsaAes, CapiNative.ProviderType.RsaAes, CapiNative.AlgorithmId.Sha384); } //// // [System.Security.SecurityCritical] protected override void Dispose(bool disposing) { try { if (disposing) { m_hashAlgorithm.Dispose(); } } finally { base.Dispose(disposing); } } ///// /// Reset the hash algorithm to begin hashing a new set of data /// //// [System.Security.SecurityCritical] public override void Initialize() { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.Initialize(); } ///// /// Hash a block of data /// //// [System.Security.SecurityCritical] protected override void HashCore(byte[] array, int ibStart, int cbSize) { Contract.Assert(m_hashAlgorithm != null); m_hashAlgorithm.HashCore(array, ibStart, cbSize); } ///// /// Complete the hash, returning its value /// //// [System.Security.SecurityCritical] protected override byte[] HashFinal() { Contract.Assert(m_hashAlgorithm != null); return m_hashAlgorithm.HashFinal(); } } } // 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
- FileSystemInfo.cs
- WebPartConnectionsConnectVerb.cs
- CommandPlan.cs
- CodeCommentStatementCollection.cs
- AttachedPropertiesService.cs
- DataExpression.cs
- ManagementObjectCollection.cs
- ComponentEvent.cs
- SoapConverter.cs
- ProcessModelInfo.cs
- ShapingWorkspace.cs
- TypeForwardedToAttribute.cs
- X509Certificate2Collection.cs
- WorkflowMarkupSerializationManager.cs
- WorkflowViewManager.cs
- _AutoWebProxyScriptEngine.cs
- WindowsBrush.cs
- HttpContextServiceHost.cs
- WebPartVerb.cs
- ConfigXmlSignificantWhitespace.cs
- ConnectorDragDropGlyph.cs
- FontConverter.cs
- CommandEventArgs.cs
- ValidationErrorInfo.cs
- Codec.cs
- HttpCacheVaryByContentEncodings.cs
- CrossAppDomainChannel.cs
- Registry.cs
- Collection.cs
- CounterSampleCalculator.cs
- NavigatorInput.cs
- StringFunctions.cs
- ToolboxItemSnapLineBehavior.cs
- PasswordTextContainer.cs
- TextPointer.cs
- ImageMetadata.cs
- ElementHostPropertyMap.cs
- FacetChecker.cs
- ToolBarOverflowPanel.cs
- ComponentResourceKeyConverter.cs
- RegistryPermission.cs
- externdll.cs
- MetadataArtifactLoaderComposite.cs
- IDispatchConstantAttribute.cs
- TextEndOfSegment.cs
- ZipIOExtraFieldZip64Element.cs
- ResourceExpression.cs
- DeferrableContent.cs
- CompilerInfo.cs
- EntityContainerEntitySetDefiningQuery.cs
- StreamGeometry.cs
- PrintPreviewGraphics.cs
- HostingEnvironmentSection.cs
- ObjectConverter.cs
- WebPartTransformer.cs
- FormsAuthentication.cs
- UnsafeNativeMethodsMilCoreApi.cs
- TypeBuilderInstantiation.cs
- MenuItemAutomationPeer.cs
- XmlCharCheckingWriter.cs
- MsmqIntegrationReceiveParameters.cs
- StreamUpdate.cs
- TextEditor.cs
- CodeArrayCreateExpression.cs
- DesignerVerb.cs
- ValidationException.cs
- GridEntry.cs
- Funcletizer.cs
- SynchronizingStream.cs
- Triangle.cs
- InvokeGenerator.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- XmlSchemaDatatype.cs
- DbParameterCollection.cs
- SqlXmlStorage.cs
- FlowPosition.cs
- PathFigure.cs
- TreeViewImageIndexConverter.cs
- XmlHelper.cs
- InnerItemCollectionView.cs
- XmlWrappingWriter.cs
- ExecutionEngineException.cs
- FunctionDescription.cs
- Scene3D.cs
- MD5.cs
- LocatorManager.cs
- ProxyWebPart.cs
- CompoundFileStreamReference.cs
- HttpDictionary.cs
- Environment.cs
- DocumentSchemaValidator.cs
- OracleParameter.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- CodeNamespaceCollection.cs
- StringValueSerializer.cs
- LineServicesRun.cs
- BaseParaClient.cs
- SerializableAttribute.cs
- TypeValidationEventArgs.cs
- HttpCapabilitiesEvaluator.cs