1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptoservices/certificateandkeymgmt/inc/pkcs7issuerserial.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,142 @@
1.4 +/*
1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @publishedPartner
1.25 + @released
1.26 +*/
1.27 +
1.28 +#ifndef __PKCS7_ISSUER_AND_SERIAL_NUMBER_H__
1.29 +#define __PKCS7_ISSUER_AND_SERIAL_NUMBER_H__
1.30 +
1.31 +#include <e32base.h>
1.32 +
1.33 +class CX500DistinguishedName;
1.34 +class CX509SubjectKeyIdExt;
1.35 +class CASN1EncSequence;
1.36 +class CASN1EncBase;
1.37 +
1.38 +
1.39 +/**
1.40 +The issuer and serial number of a PKCS#7 signature.
1.41 +*/
1.42 +class CPKCS7IssuerAndSerialNumber : public CBase
1.43 + {
1.44 +public:
1.45 + /**
1.46 + * @internalComponent
1.47 + *
1.48 + * Creates a CMS issuer and serial number object as defined in RFC2630
1.49 + * @param aIssuerName The distinguished name of the issuer. Ownership of
1.50 + * aIssuerName is transferred to the newly created object.
1.51 + * If construction fails, ownership is not transferred. The caller needs to push
1.52 + * aIssuerName onto the cleanup stack before calling this method and pop it off the
1.53 + * cleanup stack after successful construction.
1.54 + * @param aSerialNumber The serial number of the issuer.
1.55 + * @return The fully constructed object.
1.56 + **/
1.57 + static CPKCS7IssuerAndSerialNumber* NewL(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber);
1.58 +
1.59 + /**
1.60 + * @internalComponent
1.61 + *
1.62 + * Creates a CMS issuer and serial number object as defined in RFC2630
1.63 + * and leaves it on the cleanup stack.
1.64 + * @param aIssuerName The distinguished name of the issuer. Ownership of
1.65 + * aIssuerName is transferred to the newly created object.
1.66 + * If construction fails, ownership is not transferred. The caller needs to push
1.67 + * aIssuerName onto the cleanup stack before calling this method and pop it off the
1.68 + * cleanup stack after successful construction.
1.69 + * @param aSerialNumber The serial number of the issuer.
1.70 + * @return The fully constructed object.
1.71 + **/
1.72 + static CPKCS7IssuerAndSerialNumber* NewLC(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber);
1.73 +
1.74 + /**
1.75 + * @internalComponent
1.76 + *
1.77 + * Creates a CMS issuer and serial number object as defined in RFC2630.
1.78 + * @param aRawData A buffer which holds the encoded issuer and serial number.
1.79 + * @return The fully constructed object.
1.80 + **/
1.81 + static CPKCS7IssuerAndSerialNumber* NewL(const TDesC8& aRawData);
1.82 +
1.83 + /**
1.84 + Destructor.
1.85 + */
1.86 + IMPORT_C ~CPKCS7IssuerAndSerialNumber();
1.87 +
1.88 + /**
1.89 + Returns the issuer's distinguished name.
1.90 + @return The issuer's distinguished name reference.
1.91 + */
1.92 + IMPORT_C const CX500DistinguishedName& IssuerName() const;
1.93 +
1.94 + /**
1.95 + Returns the issuer's serial number.
1.96 + @return The issuer's serial number reference.
1.97 + */
1.98 + IMPORT_C const TDesC8& SerialNumber() const;
1.99 +
1.100 + /**
1.101 + * @internalComponent
1.102 + *
1.103 + * Creates the ASN1 DER sequence of the signer identifier object
1.104 + * and leaves it on the cleanup stack.
1.105 + * @return ASN1 DER sequence of this object.
1.106 + */
1.107 + CASN1EncSequence* EncodeASN1DERLC() const;
1.108 +
1.109 +private:
1.110 + /**
1.111 + Constructor
1.112 + */
1.113 + CPKCS7IssuerAndSerialNumber(void);
1.114 +
1.115 + /**
1.116 + Copy constructor
1.117 + */
1.118 + CPKCS7IssuerAndSerialNumber(const CPKCS7IssuerAndSerialNumber&);
1.119 +
1.120 + /**
1.121 + Second phase constructor
1.122 + @param aIssuerName the issuer name
1.123 + @param aSerialNumber the serial number
1.124 + */
1.125 + void ConstructL(CX500DistinguishedName* aIssuerName, const TDesC8& aSerialNumber);
1.126 +
1.127 + /**
1.128 + Second phase constructor
1.129 + @param aRawData the raw data to be decoded.
1.130 + */
1.131 + void ConstructL(const TDesC8& aRawData);
1.132 +
1.133 +private:
1.134 + /**
1.135 + Signer's distinguished name
1.136 + */
1.137 + CX500DistinguishedName* iIssuerName;
1.138 +
1.139 + /**
1.140 + Signer's serial number
1.141 + */
1.142 + HBufC8* iSerialNumber;
1.143 + };
1.144 +
1.145 +#endif