Update contrib.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
25 #ifndef __PKCS7_DIGEST_INFO_H__
26 #define __PKCS7_DIGEST_INFO_H__
34 Provides the means to decode PKCS#7 encoded DigestInfo Structure.
36 class CPKCS7DigestInfo : public CBase
40 Creates a new PKCS#7 DigestInfo object.
41 @param aRawData contains a PKCS#7 DigestInfo Structure
42 @return A pointer to the newly allocated object.
43 @leave KErrArgument if digestAlgorithm and digest is not present.
44 @leave KErrNotSupported if algorithm is other than MD2, MD5 and SHA1.
46 IMPORT_C static CPKCS7DigestInfo* NewL(const TDesC8& aRawData);
49 An Algorithm present DigestAlgorithmIdentifier.
50 @return The enum which identifies the type of Algorithm
51 used to obtain the hash.
53 IMPORT_C TAlgorithmId Algorithm() const;
56 Encoded Parameters present in the DigestAlgorithmIdentifier.
57 The client has to check for data length. It is 0 in case there are no EncodedParams
58 @return The Encoded Parameters which is in the DigestAlgorithmIdentifier.
60 IMPORT_C const TPtrC8& EncodedParams() const;
63 The Digest which is in the DigestInfo.
64 @return The Digest which is in the DigestInfo and is an Octet String.
66 IMPORT_C const TDesC8& Digest() const;
71 virtual ~CPKCS7DigestInfo();
81 @param aDigestInfo A CPKCS7DigestInfo object.
83 CPKCS7DigestInfo(const CPKCS7DigestInfo& aDigestInfo);
87 @param aDigestInfo A CPKCS7DigestInfo object.
88 @return A reference to CPKCS7DigestInfo class.
90 CPKCS7DigestInfo& operator=(const CPKCS7DigestInfo& aDigestInfo);
93 Decodes the given ASN1 DigestInfo. Below is the ASN1 syntax
95 DigestInfo ::= SEQUENCE
97 digestAlgorithm DigestAlgorithmIdentifier,
100 Digest ::= OCTET String
101 DigestAlgorithmIdentifier ::= AlgorithmIdentifier
102 AlgorithmIdentifier ::= SEQUENCE
104 algorithm ALGORITHM.&id({SupportedAlgorithms}),
105 parameters ALGORITHM.&Type({SupportedAlgorithms}{@ algorithm}) OPTIONAL
108 @param aRawData A descriptor containing the PKCS7 DigestInfo Sequence.
109 @leave KErrArgument if digestAlgorithm and digest is not present.
110 @leave KErrNotSupported if algorithm is other than MD2, MD5 and SHA1.
111 @see TASN1DecGeneric, CX509AlgorithmIdentifier.
113 void ConstructL(const TDesC8& aRawData);
117 The object identifier which identifies the message-digest algorithm.
118 A message-digest algorithm maps an octet string (the message) to
119 another octet string (the message digest)
121 TAlgorithmId iAlgorithmId;
123 /** Encoded Parameters which is in the DigestAlgorithmIdentifier */
124 TPtrC8 iEncodedParams;
127 The Digest is present in the DigestInfo.
128 It is the result of the message-digesting process
133 #endif //__PKCS7_DIGEST_INFO_H__