pkiutilities/ocsp/inc/certid.h
changeset 0 164170e6151a
equal deleted inserted replaced
-1:000000000000 0:164170e6151a
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Used in cert info objects for requests and responses.
       
    15 // Declare certID object, representing the CertID data structure from
       
    16 // the OCSP spec. Used in cert info objects for requests and responses.
       
    17 // 
       
    18 //
       
    19 
       
    20 /**
       
    21  @file 
       
    22  @internalTechnology 
       
    23 */
       
    24  
       
    25 #ifndef __OCSP_CERTID_H__
       
    26 #define __OCSP_CERTID_H__
       
    27 
       
    28 #include <hash.h>
       
    29 
       
    30 class CASN1EncBase;
       
    31 class CX509Certificate;
       
    32 
       
    33 // CertID, used in requests and responses
       
    34 NONSHARABLE_CLASS(COCSPCertID) : public CBase
       
    35 	{
       
    36 public:
       
    37 	// Make from certificates - subject mustn't be deleted in our lifetime
       
    38 	static COCSPCertID* NewL(const CX509Certificate& aSubject, const CX509Certificate& aIssuer);
       
    39 
       
    40 	// Make from binary data - which mustn't be deleted in our lifetime
       
    41 	static COCSPCertID* NewL(const TDesC8& aBinaryData);
       
    42 
       
    43 	// Construct ASN1 encoding object for the CertID data
       
    44 	CASN1EncBase* EncoderLC() const;
       
    45 
       
    46     TPtrC8 SerialNumber() const;
       
    47 
       
    48 	TBool operator==(const COCSPCertID& aRhs) const;
       
    49 
       
    50 private:
       
    51 	void ConstructL(const CX509Certificate& aSubject, const CX509Certificate& aIssuer);
       
    52 	void ConstructL(const TDesC8& aBinaryData);
       
    53 
       
    54 private:
       
    55 	TBuf8<SHA_HASH> iIssuerNameHash;
       
    56 	TBuf8<SHA_HASH> iIssuerKeyHash;
       
    57 	TPtrC8 iSerialNumber; // Refers to the input certificate or input binary data
       
    58 	};
       
    59 
       
    60 #endif