×
Namespaces

Variants
Actions
Revision as of 10:40, 28 February 2012 by croozeus (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Calculate SHA-1 hash value of a specific message.

From Nokia Developer Wiki
Jump to: navigation, search




Article Metadata
Tested with
Devices(s): E90
Compatibility
Platform(s): S60 3rd,3rd FP1,3rd Fp2
Platform Security
Capabilities: )
Article
Keywords: keywords= CSHA1,CSHA1::Update(),CSHA1::Final().
Created: lming (01 Nov 2008)
Last edited: croozeus (28 Feb 2012)

Overview

This snippet demonstrates how to Calculate SHA-1 hash value of a specific message:"SHA-1 is the best established of the existing SHA hash functions, and is employed in several widely used security applications and protocols. "

This snippet can be self-signed

Use Case

Calculate SHA-1 hash value of a specific message.

Source file

//necessary library
LIBRARY hash.lib
//necessary header file
#include <hash.h>
 
_LIT8(message1, "SHA-1 is the best established of the existing SHA hash functions, and is employed in several widely used security applications and protocols.");
 
TBuf8<32> hashValue;
CSHA1* pSha1= CSHA1::NewL();
const TPtrC8 ptr = pSha1->Hash(message1);
hashValue.Copy(ptr);
delete pSha1;

Postconditions

hashValue contains resulting SHA1 hash of message1.

This page was last modified on 28 February 2012, at 10:40.
73 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×