sl@0: /* sl@0: * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: sl@0: #ifndef __SIGNED_H__ sl@0: #define __SIGNED_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: class CRSAPublicKey; sl@0: class CDSAPublicKey; sl@0: class CDSASignature; sl@0: class CDSAParameters; sl@0: sl@0: /** Enumerates the identity of the algorithm. sl@0: * sl@0: */ sl@0: enum TAlgorithmId sl@0: { sl@0: /** An RSA algorithm. */ sl@0: ERSA, sl@0: /** A DSA algorithm. */ sl@0: EDSA, sl@0: /** A DH algorithm. */ sl@0: EDH, sl@0: /** A MD2 algorithm. */ sl@0: EMD2, sl@0: /** A MD5 algorithm. */ sl@0: EMD5, sl@0: /** A SHA-1 algorithm. */ sl@0: ESHA1, sl@0: /** A SHA-224 algorithm. */ sl@0: ESHA224, sl@0: /** A SHA-256 algorithm. */ sl@0: ESHA256, sl@0: /** A SHA-384 algorithm. */ sl@0: ESHA384, sl@0: /** A SHA-512 algorithm. */ sl@0: ESHA512 sl@0: }; sl@0: sl@0: class CValidityPeriod : public CBase sl@0: /** The period for which the certificate is valid. sl@0: * sl@0: * @since v6.0 */ sl@0: { sl@0: public: sl@0: /** Tests whether the specified date and time is within the validity period. sl@0: * sl@0: * @param aTime The date and time to be tested. sl@0: * @return ETrue, if the date and time is within the validity period; sl@0: * EFalse, otherwise. */ sl@0: IMPORT_C TBool Valid(const TTime& aTime) const; sl@0: sl@0: /** Gets the start of the validity period. sl@0: * sl@0: * @return The start date and time. */ sl@0: IMPORT_C const TTime& Start() const; sl@0: sl@0: /** Gets the end of the validity period. sl@0: * sl@0: * @return The end date and time. */ sl@0: IMPORT_C const TTime& Finish() const; sl@0: sl@0: /** Copy constructor. sl@0: * sl@0: * @param aValidityPeriod The validity period object to be copied. */ sl@0: IMPORT_C CValidityPeriod(const CValidityPeriod& aValidityPeriod); sl@0: sl@0: protected: sl@0: /** Default constructor. */ sl@0: IMPORT_C CValidityPeriod(); sl@0: sl@0: /** The start time of the validity period. */ sl@0: TTime iStart; sl@0: sl@0: /** The end time of the validity period. */ sl@0: TTime iFinish; sl@0: }; sl@0: sl@0: class CAlgorithmIdentifier : public CBase sl@0: /** Contains an algorithm ID and any encoded parameters required by that algorithm. sl@0: * sl@0: * An object of this type creates and owns a heap descriptor to contain the encoded sl@0: * parameters. sl@0: * sl@0: * @since v6.0 */ sl@0: { sl@0: public: sl@0: /** Creates a new algorithm ID object copied from an existing object. sl@0: * sl@0: * @param aAlgorithmIdentifier The algorithm ID object to be copied. sl@0: * @return A pointer to the new algorithm ID object. */ sl@0: IMPORT_C static CAlgorithmIdentifier* NewL(const CAlgorithmIdentifier& aAlgorithmIdentifier); sl@0: sl@0: /** Creates a new algorithm ID object copied from an existing object, and puts sl@0: * a pointer to the new object onto the cleanup stack. sl@0: * sl@0: * @param aAlgorithmIdentifier The algorithm ID object to be copied. sl@0: * @return A pointer to the new algorithm ID object. */ sl@0: IMPORT_C static CAlgorithmIdentifier* NewLC(const CAlgorithmIdentifier& aAlgorithmIdentifier); sl@0: sl@0: /** Creates a new algorithm ID object. sl@0: * sl@0: * @param aAlgorithmId The algorithm ID. sl@0: * @param aEncodedParams The encoded parameters. sl@0: * @return A pointer to the new algorithm ID object. */ sl@0: IMPORT_C static CAlgorithmIdentifier* NewL(TAlgorithmId& aAlgorithmId, const TDesC8& aEncodedParams); sl@0: sl@0: /** Creates a new algorithm ID object, and puts a pointer to the new object onto sl@0: * the cleanup stack. sl@0: * sl@0: * @param aAlgorithmId The algorithm ID. sl@0: * @param aEncodedParams The encoded parameters. sl@0: * @return A pointer to the new algorithm ID object. */ sl@0: IMPORT_C static CAlgorithmIdentifier* NewLC(TAlgorithmId& aAlgorithmId, const TDesC8& aEncodedParams); sl@0: sl@0: /** Tests whether this algorithm identifier object is equal to the specified algorithm sl@0: * identifier object. sl@0: * sl@0: * @param aAlgorithmIdentifier The algorithm identifier object to be compared. sl@0: * @return ETrue, if this algorithm identifier object is equal to the specified sl@0: * algorithm identifier object; EFalse otherwise. */ sl@0: IMPORT_C TBool operator == (const CAlgorithmIdentifier& aAlgorithmIdentifier) const; sl@0: sl@0: /** Gets the algorithm identifier. sl@0: * sl@0: * @return The algorithm identifier. */ sl@0: IMPORT_C TAlgorithmId Algorithm() const; //ID for the algorithm sl@0: sl@0: /** Gets the encoded parameters for the algorithm identifier. sl@0: * sl@0: * Note that this object owns the heap descriptor that owns the encoded parameters. sl@0: * sl@0: * @return The encoded parameters. */ sl@0: IMPORT_C TPtrC8 EncodedParams() const; //the encoded parameters sl@0: sl@0: /** Destructor. sl@0: * sl@0: * Frees all resources owned by the object. */ sl@0: IMPORT_C ~CAlgorithmIdentifier(); sl@0: sl@0: protected: sl@0: /** Default constructor. */ sl@0: IMPORT_C CAlgorithmIdentifier(); sl@0: sl@0: /** Constructor taking the specified parameters. sl@0: * sl@0: * @param aAlgorithmId The algorithm ID. */ sl@0: IMPORT_C CAlgorithmIdentifier(TAlgorithmId& aAlgorithmId); sl@0: sl@0: /** Second-phase constructor taking an existing algorithm identifier object. sl@0: * sl@0: * @param aAlgorithmIdentifier The algorithm identifier object. */ sl@0: IMPORT_C virtual void ConstructL(const CAlgorithmIdentifier& aAlgorithmIdentifier); sl@0: sl@0: /** Second-phase constructor taking encoded parameters. sl@0: * sl@0: * @param aEncodedParams The encoded parameters. */ sl@0: IMPORT_C virtual void ConstructL(const TDesC8& aEncodedParams); sl@0: sl@0: /** The algorithm ID. */ sl@0: TAlgorithmId iAlgorithmId; sl@0: sl@0: /** The encoded parameters for the algorithm ID. */ sl@0: HBufC8* iEncodedParams; sl@0: }; sl@0: sl@0: class CSigningAlgorithmIdentifier : public CBase sl@0: /** Contains two CAlgorithmIdentifier objects for comparison purposes. sl@0: * sl@0: * Implements an equality operator. sl@0: * sl@0: * @since v6.0 */ sl@0: { sl@0: public: sl@0: /** Constructs a new Signing Algorithm Identifier object, copying an existing Signing sl@0: * Algorithm Identifier object. sl@0: * sl@0: * @param aSigningAlgorithmIdentifier The Signing Algorithm Identifier object. sl@0: * @return The new Signing Algorithm Identifier object. */ sl@0: IMPORT_C static CSigningAlgorithmIdentifier* NewL(const CSigningAlgorithmIdentifier& aSigningAlgorithmIdentifier); sl@0: sl@0: /** Constructs a new Signing Algorithm Identifier object, copying an existing Signing sl@0: * Algorithm Identifier object, and puts a pointer to it onto the cleanup stack. sl@0: * sl@0: * @param aSigningAlgorithmIdentifier The Signing Algorithm Identifier object. sl@0: * @return The new Signing Algorithm Identifier object. */ sl@0: IMPORT_C static CSigningAlgorithmIdentifier* NewLC(const CSigningAlgorithmIdentifier& aSigningAlgorithmIdentifier); sl@0: sl@0: /** Tests whether the Signing Algorithm Identifier object is equal to the specified sl@0: * Signing Algorithm Identifier object. sl@0: * sl@0: * @param aSigningAlgorithmIdentifier The Signing Algorithm Identifier object to be compared. sl@0: * @return ETrue, if this object's Signing Algorithm Identifier value sl@0: * is equal to the specified Signing Algorithm Identifier sl@0: * object's value; EFalse, otherwise. */ sl@0: IMPORT_C TBool operator == (const CSigningAlgorithmIdentifier& aSigningAlgorithmIdentifier) const; sl@0: sl@0: /** Gets the signature ID of the asymmetric algorithm. sl@0: * sl@0: * @return The signature ID of the asymmetric algorithm. */ sl@0: IMPORT_C const CAlgorithmIdentifier& AsymmetricAlgorithm() const; sl@0: sl@0: /** Gets the signature ID of the digest algorithm. sl@0: * sl@0: * @return The signature ID of the digest algorithm. */ sl@0: IMPORT_C const CAlgorithmIdentifier& DigestAlgorithm() const; sl@0: sl@0: /** Destructor. sl@0: * sl@0: * Frees all resources owned by the object, prior to its destruction. */ sl@0: IMPORT_C ~CSigningAlgorithmIdentifier(); sl@0: sl@0: protected: sl@0: /** Second-phase constructor. sl@0: * @internalAll sl@0: */ sl@0: void ConstructL(const CSigningAlgorithmIdentifier& aSigningAlgorithmIdentifier); sl@0: sl@0: /** The signature ID of the asymmetric algorithm. */ sl@0: CAlgorithmIdentifier* iAsymmetricAlgorithm; sl@0: sl@0: /** The signature ID of the digest algorithm. */ sl@0: CAlgorithmIdentifier* iDigestAlgorithm; sl@0: }; sl@0: sl@0: class CSubjectPublicKeyInfo : public CBase sl@0: /** A base class for a container that holds information about a subject public key. sl@0: * sl@0: * It contains the algorithm ID, the encoded public key and the encoded parameters. sl@0: * sl@0: * @since v6.0 sl@0: */ sl@0: //algorithm ID + encoded public key + encoded parameters sl@0: { sl@0: public: sl@0: /** Creates a new subject public key object copied from an existing object. sl@0: * sl@0: * @param aSubjectPublicKeyInfo The subject public key object to be copied. sl@0: * @return A pointer to the new public key object. */ sl@0: IMPORT_C static CSubjectPublicKeyInfo* NewL(const CSubjectPublicKeyInfo& aSubjectPublicKeyInfo); sl@0: sl@0: /** Creates a new subject public key object copied from an existing object and sl@0: * puts a pointer to the new object onto the cleanup stack. sl@0: * sl@0: * @param aSubjectPublicKeyInfo The subject public key object to be copied. sl@0: * @return A pointer to the new public key object. */ sl@0: IMPORT_C static CSubjectPublicKeyInfo* NewLC(const CSubjectPublicKeyInfo& aSubjectPublicKeyInfo); sl@0: sl@0: /** Gets the algorithm ID. sl@0: * sl@0: * @return The algorithm ID. */ sl@0: IMPORT_C TAlgorithmId AlgorithmId() const; sl@0: sl@0: /** Gets the encoded parameters required by the algorithm. sl@0: * sl@0: * @return A non-modifiable pointer descriptor representing the encoded parameters. */ sl@0: IMPORT_C const TPtrC8 EncodedParams() const; sl@0: sl@0: /** Gets the encoded public key data. sl@0: * sl@0: * @return A non-modifiable pointer descriptor representing the encoded public sl@0: * key data. */ sl@0: IMPORT_C const TPtrC8 KeyData() const; sl@0: sl@0: /** Destructor. sl@0: * sl@0: * Frees all resources owned by the object. */ sl@0: IMPORT_C ~CSubjectPublicKeyInfo(); sl@0: protected: sl@0: /** Second-phase constructor. sl@0: * sl@0: * @param aSubjectPublicKeyInfo The subject public key object to be copied. */ sl@0: IMPORT_C virtual void ConstructL(const CSubjectPublicKeyInfo& aSubjectPublicKeyInfo); sl@0: sl@0: /** The algorithm ID. */ sl@0: CAlgorithmIdentifier* iAlgId; sl@0: sl@0: /** A heap descriptor representing the encoded key data. */ sl@0: HBufC8* iEncodedKeyData; sl@0: }; sl@0: sl@0: class CRSASignatureResult : public CBase sl@0: /** The RSA public key algorithm signature result. sl@0: * sl@0: * Derived classes: sl@0: * @li CWTLSRSASignatureResult sl@0: * @li CPKCS1SignatureResult. sl@0: * sl@0: * @see TKeyFactory::RSASignatureResultL() sl@0: * sl@0: * @since v6.0 */ sl@0: { sl@0: public: sl@0: /** Tests whether the signature result is valid. sl@0: * sl@0: * @param aResult The signature result. sl@0: * @return ETrue if the signature result is valid, otherwise EFalse. */ sl@0: IMPORT_C virtual TBool VerifyL(const TDesC8& aResult) = 0; sl@0: sl@0: /** Destructor. sl@0: * sl@0: * Frees all resources owned by the object. */ sl@0: IMPORT_C ~CRSASignatureResult(); sl@0: protected: sl@0: /** Compares this RSA Signature Result object with the specified RSA Signature sl@0: * Result object for equality. sl@0: * sl@0: * @param aResult The RSA Signature Result object to be compared. sl@0: * @return ETrue, if they are the same; EFalse, otherwise. */ sl@0: IMPORT_C TBool operator == (const CRSASignatureResult& aResult) const; sl@0: sl@0: /** The digest algorithm ID. */ sl@0: CAlgorithmIdentifier* iDigestAlgorithm; sl@0: sl@0: /** A heap descriptor representing the digest algorithm. */ sl@0: HBufC8* iDigest; sl@0: }; sl@0: sl@0: //signed object sl@0: class TKeyFactory sl@0: /** Constructs the public key objects used for signature verification from their sl@0: * encoded binary form. sl@0: * sl@0: * @since v6.0 */ sl@0: { sl@0: public: sl@0: /** Gets the RSA public key. sl@0: * sl@0: * @param aEncoding A non-modifiable descriptor representing the entire encoding. sl@0: * @return The RSA Public key. */ sl@0: virtual CRSAPublicKey* RSAPublicKeyL(const TDesC8& aEncoding) const = 0; sl@0: sl@0: /** Gets the RSA signature result. sl@0: * sl@0: * @param aDigestAlgorithm The algorithm ID. sl@0: * @param aDigest A non-modifiable descriptor representing the digest algorithm. sl@0: * @return The RSA signature result. */ sl@0: virtual CRSASignatureResult* RSASignatureResultL(const CAlgorithmIdentifier& aDigestAlgorithm, TDesC8& aDigest) const = 0; sl@0: sl@0: /** Gets the DSA public key. sl@0: * sl@0: * @param aParams The DSA parameters sl@0: * @param aEncoding A non-modifiable descriptor representing the entire encoding. sl@0: * @return The DSA public key. */ sl@0: virtual CDSAPublicKey* DSAPublicKeyL(const CDSAParameters& aParams, const TDesC8& aEncoding) const = 0; sl@0: sl@0: /** Gets the digital DSA signature given an encoding key. sl@0: * sl@0: * @param aEncoding A non-modifiable descriptor representing the entire encoding. sl@0: * @return The DSA signature. */ sl@0: virtual CDSASignature* DSASignatureL(const TDesC8& aEncoding) const = 0; sl@0: sl@0: /** Gets the DSA parameters. sl@0: * sl@0: * @param aEncoding A non-modifiable descriptor representing the entire encoding. sl@0: * @return The DSA parameters. */ sl@0: virtual CDSAParameters* DSAParametersL(const TDesC8& aEncoding) const = 0; sl@0: // New function for TKeyFactory API sl@0: virtual CDSAPublicKey* DSAPublicKeyL(const TDesC8& aParamsEncoding, const TDesC8& aEncoding) const = 0; sl@0: }; sl@0: sl@0: class CSigningKeyParameters : public CBase sl@0: /** Contains the parameter information required by some signing algorithms. sl@0: * sl@0: * The DSA signing algorithm needs parameters as well as a key. Currently, this sl@0: * class only contains DSA parameters. sl@0: * sl@0: * @since v6.0 */ sl@0: { sl@0: public: sl@0: /** Creates a new signing key parameters object. sl@0: * sl@0: * @return A pointer to the new signing key parameters object. */ sl@0: IMPORT_C static CSigningKeyParameters* NewL(); sl@0: sl@0: /** Creates a new signing key parameters object and puts a pointer to the new object sl@0: * onto the cleanup stack. sl@0: * sl@0: * @return A pointer to the new signing key parameters object. */ sl@0: IMPORT_C static CSigningKeyParameters* NewLC(); sl@0: sl@0: /** Creates a new signing key parameters object copied from an existing object. sl@0: * sl@0: * @param aParameters The signing key parameters object to be copied. sl@0: * @return A pointer to the new parameters object. */ sl@0: IMPORT_C static CSigningKeyParameters* NewL(const CSigningKeyParameters& aParameters); sl@0: sl@0: /** Creates a new signing key parameters object copied from an existing object sl@0: * and puts a pointer to the new object onto the cleanup stack. sl@0: * sl@0: * @param aParameters The signing key parameters object to be copied. sl@0: * @return A pointer to the new signing key parameters object. */ sl@0: IMPORT_C static CSigningKeyParameters* NewLC(const CSigningKeyParameters& aParameters); sl@0: sl@0: /** Destructor. sl@0: * sl@0: * Frees all resources owned by the object. */ sl@0: IMPORT_C ~CSigningKeyParameters(); sl@0: sl@0: /** Sets the DSA parameters. sl@0: * sl@0: * @param aParams The DSA parameters. */ sl@0: IMPORT_C void SetDSAParamsL(const CDSAParameters& aParams); sl@0: sl@0: /** Gets the DSA parameters. sl@0: * sl@0: * @return The DSA parameters. sl@0: * @internalAll sl@0: */ sl@0: const CDSAParameters* DSAParams() const; sl@0: private: sl@0: CSigningKeyParameters(); sl@0: void ConstructL(const CSigningKeyParameters& aParameters); sl@0: CDSAParameters* iDSAParams; sl@0: }; sl@0: sl@0: sl@0: class CSignedObject : public CBase sl@0: /** Base class for certificates. sl@0: * sl@0: * @since v6.0 */ sl@0: { sl@0: public: sl@0: /** Verifies a signature using the specified encoded key. sl@0: * sl@0: * @param aEncodedKey The encoded key. sl@0: * @return ETrue if the signature is valid, otherwise EFalse. */ sl@0: IMPORT_C TBool VerifySignatureL(const TDesC8& aEncodedKey) const; sl@0: sl@0: /** Verifies a signature using the specified encoded key and hash. sl@0: * sl@0: * @param aEncodedKey The encoded key. sl@0: * @param aHash The hash of the data to be validated. sl@0: * @return ETrue if the signature is valid, otherwise EFalse. */ sl@0: IMPORT_C TBool VerifySignatureL(const TDesC8& aEncodedKey, const TDesC8& aHash) const; sl@0: sl@0: /** Gets the digital signature. sl@0: * sl@0: * @return A non-modifiable pointer descriptor representing the digital signature. */ sl@0: IMPORT_C const TPtrC8 Signature() const; sl@0: sl@0: /** Gets the signed data. sl@0: * sl@0: * @return A non-modifiable pointer descriptor representing the signed data. */ sl@0: IMPORT_C virtual const TPtrC8 SignedDataL() const = 0; sl@0: sl@0: /** Gets the fingerprint. sl@0: * sl@0: * The fingerprint returned is the SHA1 hash of the encoding of the entire object. sl@0: * sl@0: * @return A non-modifiable pointer descriptor representing the finger print. */ sl@0: IMPORT_C const TPtrC8 Fingerprint() const; sl@0: sl@0: /** Gets the entire encoding. sl@0: * sl@0: * @return A non-modifiable pointer descriptor representing the entire encoding. */ sl@0: IMPORT_C const TPtrC8 Encoding() const; sl@0: sl@0: /** Gets the signing algorithm ID used. sl@0: * sl@0: * @return The signing algorithm ID. */ sl@0: IMPORT_C const CSigningAlgorithmIdentifier& SigningAlgorithm() const; sl@0: sl@0: /** Externalises the encoding of the entire object to a write stream. sl@0: * sl@0: * The fingerprint and the signed data can be regenerated after restoration. sl@0: * sl@0: * The presence of this function means that the standard templated operator<<() sl@0: * can be used to externalise objects of this class. sl@0: * sl@0: * @param aStream Stream to which the object should be externalised. */ sl@0: IMPORT_C virtual void ExternalizeL(RWriteStream& aStream) const; sl@0: sl@0: /** Internalises the encoded object from a read stream. sl@0: sl@0: * The class makes use of a specification-specific parser class for extracting sl@0: * the various elements, that is provided by a subclass of CSignedObject. For sl@0: * this reason this function is pure virtual. sl@0: * sl@0: * The presence of this function means that the standard templated operator>>() sl@0: * can be used to internalise objects of this class. sl@0: * sl@0: * @param aStream Stream from which the contents of the field should be internalised. */ sl@0: IMPORT_C virtual void InternalizeL(RReadStream& aStream) = 0; sl@0: sl@0: /** Sets the signing key parameters. sl@0: * sl@0: * @param aParameters The signing key parameters. */ sl@0: IMPORT_C void SetParametersL(const CSigningKeyParameters& aParameters); sl@0: sl@0: /** Gets the encoded data for the specified encoded data element, in the (to be sl@0: * signed) tbsCertificate data structure, of the signed object. sl@0: * sl@0: * @param aIndex The encoded data element position in the tbsCertificate data sl@0: * structure. See the enumeration: CX509Certificate::Anonymous. sl@0: * @return The encoded data for the specified data element of the signed object. */ sl@0: IMPORT_C virtual const TPtrC8* DataElementEncoding(const TUint aIndex) const = 0; sl@0: sl@0: /** Destructor. sl@0: * sl@0: * Frees all resources owned by the object. */ sl@0: IMPORT_C ~CSignedObject(); sl@0: sl@0: protected: sl@0: /** Verifies a RSA signature using the specified encoded key. sl@0: * sl@0: * @param aEncodedKey The encoded key. sl@0: * @return ETrue if the signature is valid, otherwise EFalse. sl@0: * @internalAll sl@0: */ sl@0: TBool VerifyRSASignatureL(const TDesC8& aEncodedKey) const; sl@0: sl@0: /** @internalAll */ sl@0: TBool VerifyRSASignatureL(const TDesC8& aEncodedKey, const TDesC8& aHash) const; sl@0: sl@0: /** A pointer to a key factory object. */ sl@0: TKeyFactory* iKeyFactory; sl@0: sl@0: /** A heap descriptor representing the entire encoding. */ sl@0: HBufC8* iEncoding; sl@0: sl@0: /** The digital signature. */ sl@0: HBufC8* iSignature; sl@0: sl@0: /** The fingerprint. sl@0: * sl@0: * The SHA1 hash of the encoding of the entire object. */ sl@0: HBufC8* iFingerprint; sl@0: sl@0: /** The signing key parameters */ sl@0: CSigningKeyParameters* iParameters; sl@0: sl@0: /** The signing algorithm ID. */ sl@0: CSigningAlgorithmIdentifier* iSigningAlgorithm; sl@0: }; sl@0: sl@0: class CCertificate : public CSignedObject sl@0: /** A data structure that binds a public key to a given individual. sl@0: * sl@0: * A certificate is a signed object, and adds a serial number, a validity period sl@0: * and a subject public key. sl@0: * sl@0: * This is a base class for classes that implement certificates of particular types. sl@0: * sl@0: * @since v6.0 */ sl@0: { sl@0: public: sl@0: /** Destructor. sl@0: * sl@0: * Frees all resources owned by the object. */ sl@0: IMPORT_C ~CCertificate(); sl@0: sl@0: /** Gets the subject public key information. sl@0: * sl@0: * @return The subject public key information. */ sl@0: IMPORT_C const CSubjectPublicKeyInfo& PublicKey() const; sl@0: sl@0: /** Gets the serial number. sl@0: * sl@0: * @return A non-modifiable pointer descriptor representing the serial number. */ sl@0: IMPORT_C const TPtrC8 SerialNumber() const; sl@0: sl@0: /** Gets the validity period. sl@0: * sl@0: * @return The validity period. */ sl@0: IMPORT_C const CValidityPeriod& ValidityPeriod() const; sl@0: sl@0: /** Tests whether a certificate is self-signed. sl@0: * sl@0: * @return ETrue, if it is self-signed; EFalse, otherwise. */ sl@0: IMPORT_C virtual TBool IsSelfSignedL() const = 0; sl@0: sl@0: /** Gets the subject. sl@0: * sl@0: * @return A heap descriptor representing the subject. */ sl@0: IMPORT_C virtual HBufC* SubjectL() const = 0; sl@0: sl@0: /** Gets the issuer. sl@0: * sl@0: * @return A heap descriptor representing the issuer. */ sl@0: IMPORT_C virtual HBufC* IssuerL() const = 0; sl@0: sl@0: /** Gets the key identifier. sl@0: * sl@0: * @return The key identifier. */ sl@0: IMPORT_C virtual TKeyIdentifier KeyIdentifierL() const; sl@0: sl@0: protected: sl@0: /** The serial number. */ sl@0: HBufC8* iSerialNumber; sl@0: sl@0: /** The validity period. */ sl@0: CValidityPeriod* iValidityPeriod; sl@0: sl@0: /** The subject public key information. */ sl@0: CSubjectPublicKeyInfo* iSubjectPublicKeyInfo; sl@0: }; sl@0: sl@0: #endif