1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptoservices/asnpkcs/inc/asnpkcs.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,613 @@
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 +#ifndef __ASNPKCS_H__
1.23 +#define __ASNPKCS_H__
1.24 +
1.25 +#include <e32std.h>
1.26 +#include <e32base.h>
1.27 +#include <s32file.h>
1.28 +#include <signed.h>
1.29 +#include <x509cert.h>
1.30 +#include <mctkeystore.h>
1.31 +
1.32 +/**
1.33 + * @file
1.34 + * @publishedPartner
1.35 + * @released
1.36 + */
1.37 +
1.38 +class CASN1EncSequence;
1.39 +class CPBEncryptParms;
1.40 +
1.41 +/**
1.42 + * This class provides the means to encode PKCS#5 parameters
1.43 + * into an ASN1 sequence as specified in the PKCS#5 specifications.
1.44 + *
1.45 + */
1.46 +class TASN1EncPKCS5
1.47 + {
1.48 +public:
1.49 + /**
1.50 + * Returns an ASN1 sequence encoding the given PKCS#5 PBE parameters.
1.51 + * The ASN1 syntax used is specified in the PKCS#5 v2.0 specifications.
1.52 + * Refer to the specs for a detailed description of the returned sequence.
1.53 + *
1.54 + * This class is used, for instance, by TASN1EncPKCS8 to specify the PBE
1.55 + * parameters of encrypted private keys.
1.56 + *
1.57 + * @param aParms The PBE parameters to be encoded
1.58 + *
1.59 + * @return An ASN1 sequence encoding the given PBE parameters.
1.60 + */
1.61 + IMPORT_C static CASN1EncSequence* EncodeDERL(const CPBEncryptParms& aParms);
1.62 + };
1.63 +
1.64 +
1.65 +/**
1.66 + * This class provides the means to decode an ASN1 sequence encoding
1.67 + * PKCS#5 PBE parameters.
1.68 + *
1.69 + */
1.70 +class TASN1DecPKCS5
1.71 + {
1.72 +public:
1.73 + /**
1.74 + * Decodes a ASN1 sequence encoding PKCS#5 PBE parameters.
1.75 + * The ASN1 syntax is specified in the PKCS#5 v2.0 specifications.
1.76 + *
1.77 + * @param aBinaryData A descriptor containing the ASN1 data in binary format.
1.78 + *
1.79 + * @return The decoded PBE parameters.
1.80 + */
1.81 + IMPORT_C static CPBEncryptParms* DecodeDERL(const TDesC8& aBinaryData);
1.82 + };
1.83 +
1.84 +//!
1.85 +//! Converts stored key data and key info to PKCS8 and returns ASN1 encoding thereof
1.86 +//!
1.87 +class CDecPKCS8Data;
1.88 +
1.89 +/// The minimum number of bytes necessary to determine that data is cleartext pkcs8
1.90 +const TInt KIsPKCS8DataMinLength = 24;
1.91 +
1.92 +/// The minimum number of bytes necessary to determine that data is encrypted pkcs8
1.93 +const TInt KIsEncryptedPKCS8DataMinLength = 36;
1.94 +
1.95 +/**
1.96 + * Provides the means to decode PKCS#8 encoded private keys.
1.97 + *
1.98 + */
1.99 +class TASN1DecPKCS8
1.100 + {
1.101 +public:
1.102 + /**
1.103 + * Decodes DER encoded ASN1 data representing a PKCS#8 clear text private key.
1.104 + * See the PKCS#8 specifications for the ASN1 syntax.
1.105 + *
1.106 + * @param aBinaryData A descriptor containing the ASN1 data.
1.107 + *
1.108 + * @return A pointer to a CDecPKCS8Data object containing the decoded private key.
1.109 + */
1.110 + IMPORT_C static CDecPKCS8Data* DecodeDERL(const TDesC8& aBinaryData);
1.111 +
1.112 + /**
1.113 + * Decodes DER encoded ASN1 data representing a PKCS#8 encrypted private key.
1.114 + * See the PKCS#8 specifications for the ASN1 syntax.
1.115 + *
1.116 + * @param aBinaryData A descriptor containing the ASN1 data.
1.117 + * @param aPassword The password to decrypt the key.
1.118 + *
1.119 + * @return A pointer to a CDecPKCS8Data object containing the decoded private key.
1.120 + */
1.121 + IMPORT_C static CDecPKCS8Data* DecodeEncryptedDERL(const TDesC8& aBinaryData, const TDesC8& aPassword);
1.122 +
1.123 + /**
1.124 + * Determines if some binary data is a pkcs#8 clear text private key.
1.125 + *
1.126 + * @param aBinaryData A descriptor containing the data. This must be at
1.127 + * least KIsPKCS8DataMinLength bytes long.
1.128 + *
1.129 + * @return ETrue if binary data is pkcs#8 clear text private key or EFalse if it is not.
1.130 + */
1.131 + IMPORT_C static TBool IsPKCS8Data(const TDesC8& aBinaryData);
1.132 +
1.133 + /**
1.134 + * Determines if some binary data is an encrypted pkcs#8 private key.
1.135 + *
1.136 + * @param aBinaryData A descriptor containing the data.
1.137 + *
1.138 + * @return ETrue if binary data is an encrypted pkcs#8 private key or EFalse if it is not.
1.139 + */
1.140 + IMPORT_C static TBool IsEncryptedPKCS8Data(const TDesC8& aBinaryData);
1.141 +
1.142 +private:
1.143 + static TBool IsASN1Sequence(const TDesC8& aBinaryData, TInt& aPos);
1.144 + static TBool IsExpectedData(const TDesC8& aBinaryData, TInt& aPos, const TDesC8& aExpectedData);
1.145 +};
1.146 +
1.147 +
1.148 +//!
1.149 +//! Server side object decodes a PKCS8 data object incoming from client
1.150 +//! On construction, decodes the data to determine version, key
1.151 +//! algorithm and gives access to the key data by creating the appropriate
1.152 +//! MPKCS8DecodedKeyPairData object for the algorithm
1.153 +//!
1.154 +//! PrivateKeyInfo ::= SEQUENCE {
1.155 +//! version Version,
1.156 +//! privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
1.157 +//! privateKey PrivateKey,
1.158 +//! attributes [0] IMPLICIT Attributes OPTIONAL }
1.159 +//!
1.160 +//! Version ::= INTEGER
1.161 +//! PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
1.162 +//! PrivateKey ::= OCTET STRING
1.163 +//! Attributes ::= SET OF Attribute
1.164 +//!
1.165 +class MPKCS8DecodedKeyPairData; // Forward declare
1.166 +
1.167 +
1.168 +/**
1.169 + * This class provides the means to decode PKCS#8 encoded private keys.
1.170 + *
1.171 + */
1.172 +class CDecPKCS8Data : public CBase
1.173 +{
1.174 +public:
1.175 + /**
1.176 + * @internalComponent
1.177 + *
1.178 + * Decodes a ASN1 sequence encoding PKCS#8 encrypted private key.
1.179 + *
1.180 + * @param aData A descriptor containing the data.
1.181 + *
1.182 + * @return A pointer to a CDecPKCS8Data object containing the decoded private key.
1.183 + */
1.184 + static CDecPKCS8Data* NewL(const TDesC8& aData);
1.185 +
1.186 +public:
1.187 + /**
1.188 + * Destructor
1.189 + */
1.190 + virtual ~CDecPKCS8Data();
1.191 +
1.192 +public:
1.193 + /*
1.194 + * Returns the version number of the certificate.
1.195 + *
1.196 + * @return Version number of the certificate.
1.197 + */
1.198 + inline TInt Version() const;
1.199 +
1.200 + /*
1.201 + * Return the algorithm identifier.
1.202 + *
1.203 + * @return algorithm identifier.
1.204 + */
1.205 + inline TAlgorithmId Algorithm() const;
1.206 +
1.207 + /*
1.208 + * Returns the key pair data. This depends on the value returned by CDecPKCS8Data::Algorithm()
1.209 + *
1.210 + * @return either RSA or DSA to M class key pair data.
1.211 + */
1.212 + inline MPKCS8DecodedKeyPairData* KeyPairData() const;
1.213 +
1.214 + /*
1.215 + * Returns a DER-encoded set of PKCS8 attributes (use TASN1DecSet to decode)
1.216 + *
1.217 + * @return a PKCS8 attributes
1.218 + */
1.219 + inline const TDesC8& PKCS8Attributes() const;
1.220 +
1.221 +protected:
1.222 + /** @internalComponent */
1.223 + CDecPKCS8Data();
1.224 + /** @internalComponent */
1.225 + void ConstructL(const TDesC8& aData);
1.226 +
1.227 +private: // No copying
1.228 + CDecPKCS8Data(const CDecPKCS8Data&);
1.229 + CDecPKCS8Data& operator=(CDecPKCS8Data&);
1.230 +
1.231 +private:
1.232 + TInt iVersion;
1.233 + TAlgorithmId iAlgorithmID;
1.234 + MPKCS8DecodedKeyPairData* iKeyPairData;
1.235 + HBufC8* iAttributes;
1.236 +};
1.237 +
1.238 +
1.239 +//! Mixin class for generic actions to be performed on a keypair
1.240 +//!
1.241 +//!
1.242 +class MPKCS8DecodedKeyPairData
1.243 +{
1.244 +public:
1.245 + /**
1.246 + * Gets a key identifier
1.247 + *
1.248 + * @param aKeyIdentifier A descriptor containing a key identifier (SHA1 hash of modulus)
1.249 + */
1.250 + virtual void GetKeyIdentifierL(TKeyIdentifier& aKeyIdentifier) const = 0;
1.251 + virtual TUint KeySize() const = 0;
1.252 + virtual void Release() = 0;
1.253 +
1.254 +protected:
1.255 + virtual ~MPKCS8DecodedKeyPairData();
1.256 +};
1.257 +
1.258 +class CRSAPublicKey;
1.259 +class CRSAPrivateKey;
1.260 +class TASN1DecGeneric;
1.261 +
1.262 +//! Represents an RSA key pair and provides the means to externalize it to
1.263 +//! a stream and generate a key identifier (SHA1 hash of modulus)
1.264 +//!
1.265 +class CPKCS8KeyPairRSA : public CBase, public MPKCS8DecodedKeyPairData
1.266 +{
1.267 +public:
1.268 + /**
1.269 + * @internalComponent
1.270 + *
1.271 + * Constructs the ASN1 PKCS#8 RSA private key.
1.272 + *
1.273 + * @param aSource A descriptor containing the key identifier
1.274 + *
1.275 + * @return A pointer to a MPKCS8DecodedKeyPairData object containing the decoded private key.
1.276 + */
1.277 + static MPKCS8DecodedKeyPairData* NewL(const TASN1DecGeneric& aSource);
1.278 +
1.279 +public:
1.280 + /**
1.281 + * Destructor
1.282 + */
1.283 + virtual ~CPKCS8KeyPairRSA();
1.284 +
1.285 +public:
1.286 + /**
1.287 + * Gets a key identifier
1.288 + *
1.289 + * @param aKeyIdentifier A descriptor containing a key identifier
1.290 + */
1.291 + virtual void GetKeyIdentifierL(TKeyIdentifier& aKeyIdentifier) const;
1.292 + virtual TUint KeySize() const;
1.293 + virtual void Release();
1.294 +
1.295 + /**
1.296 + * Contructs a RSA Public Key
1.297 + *
1.298 + * @return A RSA Public Key
1.299 + */
1.300 + inline const CRSAPublicKey& PublicKey() const;
1.301 +
1.302 + /**
1.303 + * Contructs a RSA Private Key
1.304 + *
1.305 + * @return A RSA Private Key
1.306 + */
1.307 + inline const CRSAPrivateKey& PrivateKey() const;
1.308 +
1.309 +protected:
1.310 + CPKCS8KeyPairRSA(){}
1.311 + /** @internalComponent */
1.312 + void ConstructL(const TASN1DecGeneric& aSource);
1.313 +
1.314 +private:
1.315 + CRSAPublicKey* iPublicKey;
1.316 + CRSAPrivateKey* iPrivateKey;
1.317 +};
1.318 +
1.319 +
1.320 +class CDSAPublicKey;
1.321 +class CDSAPrivateKey;
1.322 +
1.323 +//! Represents a DSA key pair and provides the means to externalize it to
1.324 +//! a stream and generate a key identifier
1.325 +//!
1.326 +class CPKCS8KeyPairDSA : public CBase, public MPKCS8DecodedKeyPairData
1.327 +{
1.328 +public:
1.329 + /**
1.330 + * @internalComponent
1.331 + *
1.332 + * Contructs the ASN1 PKCS#8 DSA private key
1.333 + *
1.334 + * @param aParamsData A block of PKCS#8 parameters data for DER data to decode
1.335 + *
1.336 + * @param aSource A descriptor containing a key identifier
1.337 + *
1.338 + * @return A pointer to MPKCS8DecodedKeyPairData object containing the decoded key.
1.339 + */
1.340 + static MPKCS8DecodedKeyPairData* NewL(const TDesC8& aParamsData, const TASN1DecGeneric& aSource);
1.341 +
1.342 +public:
1.343 + /**
1.344 + * Destructor
1.345 + */
1.346 + virtual ~CPKCS8KeyPairDSA();
1.347 +
1.348 +public:
1.349 + /**
1.350 + * Gets a key identifier
1.351 + *
1.352 + * @param aKeyIdentifier A descriptor containing a key identifier
1.353 + */
1.354 + virtual void GetKeyIdentifierL(TKeyIdentifier& aKeyIdentifier) const;
1.355 + virtual TUint KeySize() const;
1.356 + virtual void Release();
1.357 +
1.358 + /**
1.359 + * Contructs a DSA Public Key
1.360 + *
1.361 + * @return A DSA Public Key
1.362 + */
1.363 + inline const CDSAPublicKey& PublicKey() const;
1.364 +
1.365 + /**
1.366 + * Contructs a RSA Private Key
1.367 + *
1.368 + * @return A RSA Private Key
1.369 + */
1.370 + inline const CDSAPrivateKey& PrivateKey() const;
1.371 +
1.372 +protected:
1.373 + CPKCS8KeyPairDSA(){}
1.374 + /** @internalComponent */
1.375 + void ConstructL(const TDesC8& aParamsData, const TASN1DecGeneric& aSource);
1.376 +
1.377 +private:
1.378 + CDSAPublicKey* iPublicKey;
1.379 + CDSAPrivateKey* iPrivateKey;
1.380 +};
1.381 +
1.382 +class CRSAPrivateKeyCRT;
1.383 +class CASN1EncOctetString;
1.384 +class CASN1EncBase;
1.385 +class CPBEncryptParms;
1.386 +class CPBEncryptor;
1.387 +class RInteger;
1.388 +
1.389 +/**
1.390 + * Encodes the given private key using the pkcs#8 standard.
1.391 + *
1.392 + * The returned ASN1 sequence respects the following grammar:
1.393 + *
1.394 + * PrivateKeyInfo ::= SEQUENCE {
1.395 + * version Version,
1.396 + * privateKeyAlgorithm PrivateKeyAlgorithmIdentifier,
1.397 + * privateKey PrivateKey,
1.398 + * attributes [0] IMPLICIT Attributes OPTIONAL }
1.399 + *
1.400 + * Version ::= INTEGER
1.401 + * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier
1.402 + * PrivateKey ::= OCTET STRING
1.403 + * Attributes ::= SET OF Attribute
1.404 + *
1.405 + * The PrivateKeyAlgorithmIdentifier format it depends on the
1.406 + * specific algorithm it represents. For RSA is specified in
1.407 + * the PKCS#1 document, for DSA in PKCS#11.
1.408 + *
1.409 + * Or, in the case of encrypted private keys:
1.410 + *
1.411 + * EncryptedPrivateKeyInfo ::= SEQUENCE {
1.412 + * encryptionAlgorithm EncryptionAlgorithmIdentifier,
1.413 + * encryptedData EncryptedData }
1.414 + *
1.415 + * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier
1.416 + * EncryptedData ::= OCTET STRING
1.417 + *
1.418 + * AlgorithmIdentifier is the ASN1 sequence defined in the
1.419 + * PKCS#5 standard.
1.420 + */
1.421 +class TASN1EncPKCS8
1.422 + {
1.423 +public:
1.424 + /**
1.425 + * Returns the ASN1 PKCS#8 encoding of a RSA private key.
1.426 + *
1.427 + * The private key syntax for this key type is defined in
1.428 + * the PKCS#1 document. It follows the grammar:
1.429 + *
1.430 + * RSAPrivateKey ::= SEQUENCE {
1.431 + * version Version,
1.432 + * modulus INTEGER, -- n
1.433 + * publicExponent INTEGER, -- e
1.434 + * privateExponent INTEGER, -- d
1.435 + * prime1 INTEGER, -- p
1.436 + * prime2 INTEGER, -- q
1.437 + * exponent1 INTEGER, -- d mod (p-1)
1.438 + * exponent2 INTEGER, -- d mod (q-1)
1.439 + * coefficient INTEGER, -- (inverse of q) mod p
1.440 + * otherPrimeInfos OtherPrimeInfos OPTIONAL
1.441 + * }
1.442 + *
1.443 + * @param aPrivateKey The private key to be encoded (must be in CRT format)
1.444 + * @param aPublicKey The corresponding public key.
1.445 + * @param attributes A set of attributes of the extended information
1.446 + * that is encrypted along with the private-key
1.447 + * information.
1.448 + *
1.449 + * @return An ASN1 Sequence encoding the key.
1.450 + */
1.451 + IMPORT_C static CASN1EncSequence* EncodeL(const CRSAPrivateKeyCRT& aPrivateKey,
1.452 + const CRSAPublicKey& aPublicKey, const TDesC8& attributes);
1.453 + /**
1.454 + * Encodes an RSA key in encrypted format.
1.455 + *
1.456 + * @param aPrivateKey The private key to be encoded (must be in CRT format)
1.457 + * @param aPublicKey The corresponding public key.
1.458 + * @param aEncryptor The object used to encrypt the data.
1.459 + * @param aData The encryption parameters of the given encryptor.
1.460 + * These parameters are stored in the resulting sequence.
1.461 + * @param attributes A set of attributes of the extended information
1.462 + * that is encrypted along with the private-key
1.463 + * information.
1.464 + *
1.465 + * @return An ASN1 Sequence encoding the encrypted key.
1.466 + */
1.467 + IMPORT_C static CASN1EncSequence* EncodeEncryptedL(const CRSAPrivateKeyCRT& aPrivateKey,
1.468 + const CRSAPublicKey& aPublicKey,
1.469 + CPBEncryptor& aEncryptor,
1.470 + CPBEncryptParms& aData, const TDesC8& attributes);
1.471 +
1.472 + /**
1.473 + * Returns the ASN1 PKCS#8 encoding of a DSA private key.
1.474 + *
1.475 + * The private key syntax for this key type is defined in
1.476 + * the PKCS#11 document.
1.477 + *
1.478 + * @param aPrivateKey The private key to be encoded
1.479 + * @param attributes A set of attributes of the extended information
1.480 + * that is encrypted along with the private-key
1.481 + * information.
1.482 + *
1.483 + * @return An ASN1 Sequence encoding the key.
1.484 + */
1.485 + IMPORT_C static CASN1EncSequence* EncodeL(const CDSAPrivateKey& aPrivateKey, const TDesC8& attributes);
1.486 +
1.487 + /**
1.488 + * Encodes a DSA key in encrypted format.
1.489 + *
1.490 + * @param aPrivateKey The private key to be encoded.
1.491 + * @param aEncryptor The object used to encrypt the data.
1.492 + * @param aData The encryption parameters of the given encryptor.
1.493 + * These parameters are stored in the resulting sequence.
1.494 + * @param attributes
1.495 + *
1.496 + * @return An ASN1 Sequence encoding the encrypted key.
1.497 + */
1.498 + IMPORT_C static CASN1EncSequence* EncodeEncryptedL(const CDSAPrivateKey& aPrivateKey,
1.499 + CPBEncryptor& aEncryptor,
1.500 + CPBEncryptParms& aData,
1.501 + const TDesC8& attributes);
1.502 +
1.503 +private:
1.504 + /**
1.505 + *
1.506 + * Converts the ASN1 element to an octet string.
1.507 + *
1.508 + * @param aAsnElement The ASN1 element to be converted
1.509 + *
1.510 + * @return An ASN1 Octet string representing the input element.
1.511 + */
1.512 + static CASN1EncOctetString* ElementToOctetL(CASN1EncBase& aAsnElement);
1.513 +
1.514 + /**
1.515 + * Given a ASN1 sequence representing a private key and a CPBEncryptor object,
1.516 + * it returns an ASN1 octet string containing the key sequence encrypted by
1.517 + * the given encryptor.
1.518 + *
1.519 + * @param aKeySeq The key sequence to be encrypted.
1.520 + * @param aEncryptor The CPBEncryptor object used to encrypt the given key.
1.521 + *
1.522 + * @return An ASN1 octet string containing the encrypted key.
1.523 + */
1.524 + static CASN1EncOctetString* EncryptKeySequenceL(CASN1EncSequence& aKeySeq,
1.525 + CPBEncryptor& aEncryptor);
1.526 +
1.527 + /**
1.528 + *
1.529 + * Given a valid key sequence and appropriate PBE encryptors it
1.530 + * encrypts the key and creates a PKCS#8 sequence of type
1.531 + * EncryptedPrivateKeyInfo.
1.532 + *
1.533 + * @param aPrivateKeySequence A ASN1 sequence of the private key to be
1.534 + * encrypted. Generally the structure of the
1.535 + * sequence will depend on the key type.
1.536 + * @param aEncryptor The PBE encryptor to be used to encrypt the key.
1.537 + * @param aData The PBE encryptor parameters. This information must be
1.538 + * included in the final ASN1 sequence.
1.539 + *
1.540 + * @return An ASN1 sequence of type EncryptedPrivateKeyInfo.
1.541 + */
1.542 + static CASN1EncSequence* EncryptedSequenceL(CASN1EncSequence& aPrivateKeySequence,
1.543 + CPBEncryptor& aEncryptor,
1.544 + CPBEncryptParms& aData);
1.545 +
1.546 + /**
1.547 + * Given a CRT RSA private key it calculates the RSA private exponent "d".
1.548 + *
1.549 + * @param aPrivateKey The RSA private key in CRT format we are interested in.
1.550 + * @param aPublicKey The RSA public key
1.551 + *
1.552 + * @return The RSA private exponent "d".
1.553 + */
1.554 + static const RInteger CalculateRSAPrivExpL(const CRSAPrivateKeyCRT& aPrivateKey, const CRSAPublicKey& aPublicKey);
1.555 +
1.556 + /**
1.557 + * Adds the given DER encoded ASN1 structure to the given sequence. If the structure is KNullDesC8
1.558 + * nothing is added. This method is used by the encoder to add the optional pkcs8 attributes to
1.559 + * the ASN1 pkcs8 key it generates. PKCS8 attributes are stored as uninterpreted DER encoded
1.560 + * binary data in the keystore.
1.561 + *
1.562 + * @param aAttribute The DER encoded ASN1 structure.
1.563 + * @param aSeq The sequence to which we want to add the attributes.
1.564 + */
1.565 + static void AddAttributesL(CASN1EncSequence& aSeq, const TDesC8& aAttribute);
1.566 + };
1.567 +
1.568 +// Inline function definition //
1.569 +
1.570 +inline TInt CDecPKCS8Data::Version() const
1.571 + {
1.572 + return (iVersion);
1.573 + }
1.574 +
1.575 +inline TAlgorithmId CDecPKCS8Data::Algorithm() const
1.576 + {
1.577 + return (iAlgorithmID);
1.578 + }
1.579 +
1.580 +inline MPKCS8DecodedKeyPairData* CDecPKCS8Data::KeyPairData() const
1.581 + {
1.582 + return (iKeyPairData);
1.583 + }
1.584 +
1.585 +
1.586 +inline const TDesC8& CDecPKCS8Data::PKCS8Attributes() const
1.587 + {
1.588 + if (iAttributes)
1.589 + return (*iAttributes);
1.590 + else
1.591 + return (KNullDesC8);
1.592 + }
1.593 +
1.594 +inline const CRSAPublicKey& CPKCS8KeyPairRSA::PublicKey() const
1.595 + {
1.596 + return *iPublicKey;
1.597 + }
1.598 +
1.599 +inline const CRSAPrivateKey& CPKCS8KeyPairRSA::PrivateKey() const
1.600 + {
1.601 + return *iPrivateKey;
1.602 + }
1.603 +
1.604 +inline const CDSAPublicKey& CPKCS8KeyPairDSA::PublicKey() const
1.605 + {
1.606 + return *iPublicKey;
1.607 + }
1.608 +
1.609 +inline const CDSAPrivateKey& CPKCS8KeyPairDSA::PrivateKey() const
1.610 + {
1.611 + return *iPrivateKey;
1.612 + }
1.613 +
1.614 +
1.615 +
1.616 +#endif // __ASNPKCS_H__