os/security/cryptoservices/certificateandkeymgmt/inc/pkcs7issuerserial.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 /**
    20  @file
    21  @publishedPartner
    22  @released
    23 */
    24 
    25 #ifndef __PKCS7_ISSUER_AND_SERIAL_NUMBER_H__
    26 #define __PKCS7_ISSUER_AND_SERIAL_NUMBER_H__
    27 
    28 #include <e32base.h>
    29 
    30 class CX500DistinguishedName;
    31 class CX509SubjectKeyIdExt;
    32 class CASN1EncSequence;
    33 class CASN1EncBase;
    34 
    35 
    36 /**
    37 The issuer and serial number of a PKCS#7 signature.
    38 */
    39 class CPKCS7IssuerAndSerialNumber : public CBase
    40 	{
    41 public:
    42 	/**
    43 	 * @internalComponent
    44 	 *
    45 	 * Creates a CMS issuer and serial number object as defined in RFC2630
    46 	 * @param aIssuerName The distinguished name of the issuer. Ownership of
    47 	 *	aIssuerName is transferred to the newly created object.
    48 	 *	If construction fails, ownership is not transferred. The caller needs to push
    49 	 *	aIssuerName onto the cleanup stack before calling this method and pop it off the
    50 	 *	cleanup stack after successful construction.
    51 	 * @param aSerialNumber The serial number of the issuer.
    52 	 * @return The fully constructed object.
    53 	 **/
    54 	static CPKCS7IssuerAndSerialNumber* NewL(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber);
    55 
    56 	/**
    57 	 * @internalComponent
    58 	 *
    59 	 * Creates a CMS issuer and serial number object as defined in RFC2630
    60 	 *	and leaves it on the cleanup stack.
    61 	 * @param aIssuerName The distinguished name of the issuer. Ownership of
    62 	 *	aIssuerName is transferred to the newly created object.
    63 	 *	If construction fails, ownership is not transferred. The caller needs to push
    64 	 *	aIssuerName onto the cleanup stack before calling this method and pop it off the
    65 	 *	cleanup stack after successful construction.
    66 	 * @param aSerialNumber The serial number of the issuer.
    67 	 * @return The fully constructed object.
    68 	 **/	
    69 	static CPKCS7IssuerAndSerialNumber* NewLC(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber);
    70 	
    71 	/**
    72 	 * @internalComponent
    73 	 *
    74 	 * Creates a CMS issuer and serial number object as defined in RFC2630.
    75 	 * @param aRawData A buffer which holds the encoded issuer and serial number.
    76 	 * @return The fully constructed object.
    77 	 **/	
    78 	static CPKCS7IssuerAndSerialNumber* NewL(const TDesC8& aRawData);
    79 	
    80 	/**
    81 	Destructor.
    82 	*/
    83 	IMPORT_C ~CPKCS7IssuerAndSerialNumber();
    84 	
    85 	/**
    86 	Returns the issuer's distinguished name.
    87 	@return The issuer's distinguished name reference.
    88 	*/
    89 	IMPORT_C const CX500DistinguishedName& IssuerName() const;
    90 	
    91 	/**
    92 	Returns the issuer's serial number.
    93 	@return The issuer's serial number reference.
    94 	*/
    95 	IMPORT_C const TDesC8& SerialNumber() const;
    96 
    97 	/**
    98 	 * @internalComponent
    99 	 * 
   100 	 * Creates the ASN1 DER sequence of the signer identifier object
   101 	 * and leaves it on the cleanup stack.
   102 	 * @return  ASN1 DER sequence of this object.
   103 	 */
   104 	CASN1EncSequence* EncodeASN1DERLC() const;
   105 		
   106 private:
   107 	/**
   108 	Constructor
   109 	*/
   110 	CPKCS7IssuerAndSerialNumber(void);
   111 	
   112 	/**
   113 	Copy constructor
   114 	*/
   115 	CPKCS7IssuerAndSerialNumber(const CPKCS7IssuerAndSerialNumber&);
   116 	
   117 	/**
   118 	Second phase constructor
   119 	@param aIssuerName the issuer name
   120 	@param aSerialNumber the serial number
   121 	*/
   122 	void ConstructL(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber);
   123 
   124 	/**
   125 	Second phase constructor
   126 	@param aRawData the raw data to be decoded.
   127 	*/	
   128 	void ConstructL(const TDesC8& aRawData);
   129 	
   130 private:
   131 	/**
   132 	Signer's distinguished name
   133 	*/
   134 	CX500DistinguishedName* iIssuerName;
   135 	
   136 	/**
   137 	Signer's serial number
   138 	*/
   139 	HBufC8* iSerialNumber;
   140 	};
   141 	
   142 #endif