epoc32/include/x509cert.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
    15 * X509 certificate implementation
    15 * X509 certificate implementation
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 
       
    21 
       
    22 /**
    20 /**
    23  @file 
    21  @file 
    24  @internalAll
    22  @publishedAll
       
    23  @released
    25 */
    24 */
    26  
    25  
    27 #ifndef __X509CERT_H__
    26 #ifndef __X509CERT_H__
    28 #define __X509CERT_H__
    27 #define __X509CERT_H__
    29 
    28 
    32 #include <s32std.h>
    31 #include <s32std.h>
    33 #include <signed.h>
    32 #include <signed.h>
    34 #include <x500dn.h>
    33 #include <x500dn.h>
    35 #include <asn1enc.h>
    34 #include <asn1enc.h>
    36 
    35 
       
    36 /* These OIDs have been defined for PKCS#1 with the 
       
    37  * superior reference to OID 1.2.840.113549.1.1
       
    38  * {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-1(1)}
       
    39  */ 
       
    40 // RSA (PKCS #1 v1.5) key transport algorithm
       
    41 _LIT(KRSA,"1.2.840.113549.1.1.1");
       
    42 // MD2 with RSA Encryption
    37 _LIT(KMD2WithRSA,"1.2.840.113549.1.1.2");
    43 _LIT(KMD2WithRSA,"1.2.840.113549.1.1.2");
       
    44 // RSA (PKCS #1 v1.5) with MD5 signature
    38 _LIT(KMD5WithRSA,"1.2.840.113549.1.1.4");
    45 _LIT(KMD5WithRSA,"1.2.840.113549.1.1.4");
       
    46 // RSA (PKCS #1 v1.5) with SHA-1 signature 
    39 _LIT(KSHA1WithRSA,"1.2.840.113549.1.1.5");
    47 _LIT(KSHA1WithRSA,"1.2.840.113549.1.1.5");
    40 _LIT(KDSAWithSHA1,"1.2.840.10040.4.3");
    48 // SHA256 with RSA Encryption
    41 
    49 _LIT(KSHA256WithRSA,"1.2.840.113549.1.1.11");
    42 _LIT(KRSA,"1.2.840.113549.1.1.1");
    50 // SHA384 with RSA Encryption 
       
    51 _LIT(KSHA384WithRSA,"1.2.840.113549.1.1.12");
       
    52 // SHA512 with RSA Encryption 
       
    53 _LIT(KSHA512WithRSA,"1.2.840.113549.1.1.13");
       
    54 // SHA224 with RSA Encryption 
       
    55 _LIT(KSHA224WithRSA,"1.2.840.113549.1.1.14");
       
    56 
       
    57 /* 
       
    58  * These OIDs have been defined for PKIX with the 
       
    59  * superior reference to OID 1.2.840.10040.
       
    60  */
       
    61 // Digital Signature Algorithm (DSA), also known as the Digital Signature Standard (DSS) 
       
    62 _LIT(KDSA,"1.2.840.10040.4.1");
       
    63 // ANSI X9.57 DSA signature generated with SHA-1 hash (DSA x9.30) 
       
    64 _LIT(KDSAWithSHA1,	"1.2.840.10040.4.3");
       
    65 
       
    66 /*
       
    67  * These OIDs have been defined for ANSI X9 standard with 
       
    68  * superior reference to oid 1.2.840.10046.
       
    69  * {iso(1) member-body(2) us(840) ansi-x942(10046) number-types(2)}
       
    70  */
       
    71 // ANSI X9.42 Ephemeral-Static Diffie-Hellman key agreement algorithm 
    43 _LIT(KDH,"1.2.840.10046.2.1");
    72 _LIT(KDH,"1.2.840.10046.2.1");
    44 _LIT(KDSA,"1.2.840.10040.4.1");
    73 
       
    74 /*
       
    75  * These OIDs have been defined for digest algorithms with 
       
    76  * superior reference to oid 1.2.840.113549.2
       
    77  * {iso(1) member-body(2) us(840) rsadsi(113549) digestAlgorithm(2)}
       
    78  */
    45 _LIT(KMD5,"1.2.840.113549.2.5");
    79 _LIT(KMD5,"1.2.840.113549.2.5");
    46 _LIT(KMD2,"1.2.840.113549.2.2");
    80 _LIT(KMD2,"1.2.840.113549.2.2");
       
    81 
       
    82 /*
       
    83  * These OIDs have been defined for hash algorithms conforming NIST algorithms 
       
    84  * with superior reference to oid 2.16.840.1.101.3.4.2
       
    85  * {joint-iso-itu-t(2) country(16) us(840) organization(1) gov(101) csor(3) nistAlgorithm(4) hashAlgs(2)}
       
    86  */
       
    87 _LIT(KSHA256,"2.16.840.1.101.3.4.2.1");
       
    88 _LIT(KSHA384,"2.16.840.1.101.3.4.2.2");
       
    89 _LIT(KSHA512,"2.16.840.1.101.3.4.2.3");
       
    90 _LIT(KSHA224,"2.16.840.1.101.3.4.2.4");
       
    91 
       
    92 /*
       
    93  * These OIDs are for OIW Security Special Interest Group defined algorithms  
       
    94  * with superior reference to oid 1.3.14.3.2
       
    95  * {iso(1) identified-organization(3) oiw(14) secsig(3) algorithms(2)}
       
    96  */
       
    97 // SHA1 with RSA signature (obsolete)
       
    98 _LIT(KSHA1WithRSASignature,"1.3.14.3.2.29");
       
    99 // Hash algorithm identifier SHA-1 (Secure Hash Algorithm, Revision 1) 
    47 _LIT(KSHA1,"1.3.14.3.2.26");
   100 _LIT(KSHA1,"1.3.14.3.2.26");
    48 
   101 
    49 /** The maximum number of allowed data elements.
   102 /** The maximum number of allowed data elements.
    50 * 
   103 * 
    51 * @since v7.0 */
   104 * @since v7.0 */
    57 class CDSAParameters;
   110 class CDSAParameters;
    58 
   111 
    59 class CPKCS1SignatureResult : public CRSASignatureResult
   112 class CPKCS1SignatureResult : public CRSASignatureResult
    60 /** The signature result in PKCS#1 format.
   113 /** The signature result in PKCS#1 format.
    61 * 
   114 * 
    62 * @publishedAll
       
    63 * @released
       
    64 * @since v6.0 */
   115 * @since v6.0 */
    65 	{
   116 	{
    66 public:
   117 public:
    67 	/** Creates a new algorithm ID object copied from an existing object.
   118 	/** Creates a new algorithm ID object copied from an existing object.
    68 	* 
   119 	* 
    91 
   142 
    92 class TX509KeyFactory : public TKeyFactory
   143 class TX509KeyFactory : public TKeyFactory
    93 /** Constructs the public key objects used for signature verification, from their 
   144 /** Constructs the public key objects used for signature verification, from their 
    94 * encoded binary form, for X.509 certificates.
   145 * encoded binary form, for X.509 certificates.
    95 * 
   146 * 
    96 * @publishedAll
       
    97 * @released
       
    98 * @since v6.0 */
   147 * @since v6.0 */
    99 	{
   148 	{
   100 public:
   149 public:
   101 	/** Gets the RSA public key from the encoding key.
   150 	/** Gets the RSA public key from the encoding key.
   102 	* 
   151 	* 
   141 	};
   190 	};
   142 
   191 
   143 class CX509ValidityPeriod : public CValidityPeriod
   192 class CX509ValidityPeriod : public CValidityPeriod
   144 /** The period for which an X.509 certificate is valid.
   193 /** The period for which an X.509 certificate is valid.
   145 * 
   194 * 
   146 * @publishedAll
       
   147 * @released
       
   148 * @since v6.0 */
   195 * @since v6.0 */
   149 	{
   196 	{
   150 public:
   197 public:
   151 	/** Creates a new X.509 validity period object from the specified buffer containing 
   198 	/** Creates a new X.509 validity period object from the specified buffer containing 
   152 	* the binary coded representation.
   199 	* the binary coded representation.
   192 	};
   239 	};
   193 
   240 
   194 class CX509AlgorithmIdentifier : public CAlgorithmIdentifier
   241 class CX509AlgorithmIdentifier : public CAlgorithmIdentifier
   195 /** Algorithm identifier for an X.509 certificate.
   242 /** Algorithm identifier for an X.509 certificate.
   196 *
   243 *
   197 * @publishedAll
       
   198 * @released
       
   199 * @since v6.0 */
   244 * @since v6.0 */
   200 	{
   245 	{
   201 public:
   246 public:
   202 	/** Creates a new X.509 algorithm identifier object from the specified buffer containing 
   247 	/** Creates a new X.509 algorithm identifier object from the specified buffer containing 
   203 	* the binary coded representation.
   248 	* the binary coded representation.
   264 	};
   309 	};
   265 
   310 
   266 class CX509SigningAlgorithmIdentifier : public CSigningAlgorithmIdentifier
   311 class CX509SigningAlgorithmIdentifier : public CSigningAlgorithmIdentifier
   267 /** Encapsulates the IDs of the algorithms used for signing an X.509 certificate.
   312 /** Encapsulates the IDs of the algorithms used for signing an X.509 certificate.
   268 *
   313 *
   269 * @publishedAll
       
   270 * @released
       
   271 * @since v6.0 */
   314 * @since v6.0 */
   272 	{
   315 	{
   273 public:
   316 public:
   274 	/** Creates a new X.509 signing algorithm Id object from the specified buffer containing 
   317 	/** Creates a new X.509 signing algorithm Id object from the specified buffer containing 
   275 	* the binary coded representation.
   318 	* the binary coded representation.
   320 	};
   363 	};
   321 
   364 
   322 class CX509SubjectPublicKeyInfo : public CSubjectPublicKeyInfo
   365 class CX509SubjectPublicKeyInfo : public CSubjectPublicKeyInfo
   323 /** X.509 subject public key information.
   366 /** X.509 subject public key information.
   324 * 
   367 * 
   325 * @publishedAll
       
   326 * @released
       
   327 * @since v6.0 */
   368 * @since v6.0 */
   328 	{
   369 	{
   329 public:
   370 public:
   330 	/** Creates a new X.509 subject public key object from the specified buffer containing 
   371 	/** Creates a new X.509 subject public key object from the specified buffer containing 
   331 	* the binary coded representation.
   372 	* the binary coded representation.
   370 * by an instance of this class and uses it to create the specific extension.
   411 * by an instance of this class and uses it to create the specific extension.
   371 * 
   412 * 
   372 * Consists of an any-defined-by structure along with a boolean flag saying whether 
   413 * Consists of an any-defined-by structure along with a boolean flag saying whether 
   373 * the extension is critical or not.
   414 * the extension is critical or not.
   374 * 
   415 * 
   375 * @publishedAll
       
   376 * @released
       
   377 * @since v6.0 */
   416 * @since v6.0 */
   378 	{
   417 	{
   379 public:
   418 public:
   380 	/** Creates a new generic X.509 certificate extension object from an existing object.
   419 	/** Creates a new generic X.509 certificate extension object from an existing object.
   381 	* 
   420 	* 
   491 	};
   530 	};
   492 
   531 
   493 class CX509Certificate : public CCertificate
   532 class CX509Certificate : public CCertificate
   494 /** An X.509 certificate.
   533 /** An X.509 certificate.
   495 * 
   534 * 
   496 * @publishedAll
       
   497 * @released
       
   498 * @since v6.0 */
   535 * @since v6.0 */
   499 	{
   536 	{
   500 public:
   537 public:
   501 /** Enumerates values for encoded data element positions in the TBSCertificate data structure.
   538 /** Enumerates values for encoded data element positions in the TBSCertificate data structure.
   502 * 
   539 *