Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

587 lines
23 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. PKCSlib
  5. Abstract:
  6. This header file describes the services and definitions necessary to use the
  7. Crypto Certificate API.
  8. Author:
  9. Doug Barlow (dbarlow) 8/17/1995
  10. Environment:
  11. Win32, Crypto API
  12. Notes:
  13. Current X.509 Support Level : V3
  14. Current PKCS Support Level : V1
  15. --*/
  16. #ifndef _PKCSLIB_H_
  17. #define _PKCSLIB_H_
  18. #include <wincrypt.h>
  19. #ifdef _cplusplus
  20. extern "C" {
  21. #endif
  22. #ifndef PKCSDLLAPI
  23. #define PKCSDLLAPI
  24. #endif
  25. typedef const void *
  26. PKCSHANDLE;
  27. //
  28. //==============================================================================
  29. //
  30. // Attribute List services.
  31. //
  32. // Also see the list of standard Attribute types, below.
  33. //
  34. typedef PKCSHANDLE
  35. ATTRIBLISTHANDLE; // Reference handle type.
  36. typedef ATTRIBLISTHANDLE
  37. *PATTRIBLISTHANDLE, // Pointers to reference handles.
  38. *LPATTRIBLISTHANDLE;
  39. extern PKCSDLLAPI BOOL WINAPI
  40. PkcsAttributeListCreate(
  41. OUT LPATTRIBLISTHANDLE hAtrList); // Handle for future reference.
  42. extern PKCSDLLAPI BOOL WINAPI
  43. PkcsAttributeListClose(
  44. IN ATTRIBLISTHANDLE hAtrList); // The handle to the attrList to discard
  45. extern PKCSDLLAPI BOOL WINAPI
  46. PkcsAttributeListAdd(
  47. IN ATTRIBLISTHANDLE hAtrList, // The reference handle to the List.
  48. IN LPCTSTR szAtrType, // The Object Identifier of the attribute
  49. IN const BYTE * pbAtrValue); // The Value of the ASN.1 encoded attribute
  50. extern PKCSDLLAPI BOOL WINAPI
  51. PkcsAttributeListLookup(
  52. IN ATTRIBLISTHANDLE hAtrList, // The reference handle to the List.
  53. IN LPCTSTR szAtrType, // The Object Identifier of the attribute
  54. OUT LPBYTE pbAtrValue, // The value of the attribute
  55. IN OUT LPDWORD pcbAtrValLen); // The length of the pbAtrValue buffer
  56. extern PKCSDLLAPI BOOL WINAPI
  57. PkcsAttributeListContents(
  58. IN ATTRIBLISTHANDLE hAtrList, // The reference handle to the List.
  59. OUT LPTSTR mszAtrTypes, // The Object Identifier list
  60. IN OUT LPDWORD pcbAtrTypesLen); // The length of the mszAtrTypes buffer
  61. //
  62. // ?Q? - Is there any need for a remove service?
  63. //
  64. //
  65. //==============================================================================
  66. //
  67. // X.509 v3 Certificate Extension List services.
  68. //
  69. // ?TODO?
  70. //
  71. typedef PKCSHANDLE
  72. EXTENSIONLISTHANDLE; // Reference handle type.
  73. typedef EXTENSIONLISTHANDLE
  74. *PEXTENSIONLISTHANDLE, // Pointers to reference handles.
  75. *LPEXTENSIONLISTHANDLE;
  76. //
  77. //==============================================================================
  78. //
  79. // Subject services. To use these services, you must have created a
  80. // key, either directly via the CryptoAPI, or via the
  81. // convenience service PkcsCreateSubject.
  82. //
  83. typedef PKCSHANDLE
  84. SUBJECTHANDLE; // Reference handle type.
  85. typedef SUBJECTHANDLE
  86. *PSUBJECTHANDLE, // Pointers to reference handles.
  87. *LPSUBJECTHANDLE;
  88. extern PKCSDLLAPI BOOL WINAPI
  89. PkcsSetDNamePrefix(
  90. IN DWORD dwStore, // The Certificate Store.
  91. IN LPCTSTR szPrefix); // The Prefix to set.
  92. extern PKCSDLLAPI BOOL WINAPI
  93. PkcsSubjectCreate(
  94. OUT LPSUBJECTHANDLE phSubject, // Handle for future reference
  95. IN LPCTSTR szKeySet, // What to name the new Subject keyset
  96. IN LPCTSTR szProvider, // The specific name of the CSP, or Blank
  97. IN DWORD dwKeyType, // Specifies the type of key
  98. IN DWORD dwProvType, // Should be PROV_RSA_FULL
  99. IN ALG_ID algPref, // Suggest optional algorithm preferences
  100. IN DWORD dwStore); // Store Id or zero.
  101. extern PKCSDLLAPI BOOL WINAPI
  102. PkcsSubjectOpen(
  103. OUT LPSUBJECTHANDLE phSubject, // Handle for future reference
  104. IN LPCTSTR szKeySet, // The name of the Subject keyset
  105. IN LPCTSTR szProvider, // The specific name of the CSP, or Blank
  106. IN DWORD dwKeyType, // Specifies the type of key
  107. IN DWORD dwProvType, // Should be PROV_RSA_FULL
  108. IN ALG_ID algPref, // Suggest optional algorithm preferences
  109. IN DWORD dwStore); // Store Id or zero.
  110. extern PKCSDLLAPI BOOL WINAPI
  111. PkcsSubjectSign(
  112. IN SUBJECTHANDLE hSubject, // The reference handle to the Subject
  113. IN const BYTE *pbData, // The data to be signed
  114. IN DWORD cbDataLen, // The length of the data to be signed
  115. IN LPCTSTR szComment, // Comment string associated with signature
  116. OUT LPBYTE pbSignature, // Buffer to receive the signature
  117. IN OUT LPDWORD pcbSigLen); // Length of the pbSignature buffer.
  118. extern PKCSDLLAPI BOOL WINAPI
  119. PkcsSubjectClose(
  120. IN SUBJECTHANDLE hSubject); // The reference handle to the Subject
  121. extern PKCSDLLAPI BOOL WINAPI
  122. PkcsSubjectDelete(
  123. IN SUBJECTHANDLE hSubject); // The handle to the Subject to remove
  124. extern PKCSDLLAPI BOOL WINAPI
  125. PkcsSubjectRequestCertification(
  126. IN SUBJECTHANDLE hSubject, // The reference handle to the Subject
  127. IN ATTRIBLISTHANDLE hAtrList, // reference to subject attributes, if any
  128. OUT LPBYTE pbCertReq, // Buffer to receive certificate request
  129. IN OUT LPDWORD pcbCertReqLen); // Length of pbCertReq buffer
  130. extern PKCSDLLAPI BOOL WINAPI
  131. PkcsSubjectDistinguishedName(
  132. IN SUBJECTHANDLE hSubject, // The reference handle to the Subject
  133. OUT LPTSTR szDname, // Buffer to receive the distinguished name
  134. IN OUT LPDWORD pcbDnameLen); // Length of pbCertReq buffer
  135. //
  136. // ?TODO? - Need to attach an X.509 v2 UniqueIdentifier to the Subject.
  137. // ?HOW? - Can we attach an X.509 v2 UniqueIdentifier to the request?
  138. //
  139. //
  140. //==============================================================================
  141. //
  142. // Issuer services. To use these services, you must have created an
  143. // AT_SIGNATURE key, either directly via the CryptoAPI, or via the
  144. // convienience service PkcsCreateIssuer, and you will be certifying
  145. // other's keys.
  146. //
  147. typedef PKCSHANDLE
  148. ISSUERHANDLE; // Reference handle type.
  149. typedef ISSUERHANDLE
  150. *PISSUERHANDLE, // Pointers to reference handles.
  151. *LPISSUERHANDLE;
  152. extern PKCSDLLAPI BOOL WINAPI
  153. PkcsIssuerCreate(
  154. OUT LPISSUERHANDLE phIssuer, // Handle for future reference
  155. IN LPCTSTR szKeySet, // What to name the new Issuer keyset
  156. IN LPCTSTR szProvider, // The specific name of the CSP, or Blank
  157. IN DWORD dwProvType, // Should be PROV_RSA_FULL
  158. IN ALG_ID algPref, // Suggest optional algorithm preferences
  159. IN DWORD dwStore); // Store Id or zero.
  160. extern PKCSDLLAPI BOOL WINAPI
  161. PkcsIssuerOpen(
  162. OUT LPISSUERHANDLE phIssuer, // Handle for future reference
  163. IN LPCTSTR szKeySet, // The name of the Issuer keyset
  164. IN LPCTSTR szProvider, // The specific name of the CSP, or Blank
  165. IN DWORD dwProvType, // Should be PROV_RSA_FULL
  166. IN ALG_ID algPref, // Suggest optional algorithm preferences
  167. IN DWORD dwStore); // Store Id or zero.
  168. extern PKCSDLLAPI BOOL WINAPI
  169. PkcsIssuerClose(
  170. IN ISSUERHANDLE hIssuer); // The reference handle to the Issuer
  171. extern PKCSDLLAPI BOOL WINAPI
  172. PkcsIssuerDelete(
  173. IN ISSUERHANDLE hIssuer); // The handle to the Issuer to remove
  174. extern PKCSDLLAPI BOOL WINAPI
  175. PkcsIssuerRequestCertification(
  176. IN ISSUERHANDLE hIssuer, // The reference handle to the Issuer
  177. IN ATTRIBLISTHANDLE hAtrList, // reference to issuer attributes, if any
  178. OUT LPBYTE pbCertReq, // Buffer to receive the certificate request
  179. IN OUT LPDWORD pcbCertReqLen); // Length of the pbCertReq buffer
  180. //
  181. // ?TODO? - Need to attach an X.509 v2 UniqueIdentifier to the Issuer.
  182. // It would be nice to get at the X.509 name. Other info?
  183. // ?HOW? - How can we attach an X.509 v2 UniqueIdentifier to the request?
  184. //
  185. extern PKCSDLLAPI BOOL WINAPI
  186. PkcsIssuerIssueLocalCA(
  187. IN ISSUERHANDLE hIssuer, // The reference handle to the Issuer
  188. OUT LPBYTE pbCert, // Buffer to receive certificate
  189. IN OUT LPDWORD pcbCertLen); // Length of the pbCert buffer.
  190. extern PKCSDLLAPI BOOL WINAPI
  191. PkcsIssuerCertify(
  192. IN ISSUERHANDLE hIssuer, // The reference handle to the Issuer
  193. IN const BYTE *pbCertReq, // Buffer containing the certificate request
  194. IN const BYTE *pbSerialNo, // Serial number to assign to certificate
  195. IN DWORD cbSerialNoLen, // Length of the serial number
  196. IN LPFILETIME pftStartDate, // Effective date of the certificate
  197. IN LPFILETIME pftEndDate, // Termination date of the certificate
  198. OUT LPBYTE pbCert, // Buffer to receive the certificate
  199. IN OUT LPDWORD pcbCertLen); // Length of the pbCert buffer.
  200. extern PKCSDLLAPI BOOL WINAPI
  201. PkcsIssuerRecertify(
  202. IN ISSUERHANDLE hIssuer, // The reference handle to the Issuer
  203. IN const BYTE *pbInCert, // Buffer containing the old certificate
  204. IN const BYTE *pbSerialNo, // Serial number to assign to certificate
  205. IN DWORD cbSerialNoLen, // Length of the serial number
  206. IN LPFILETIME pftStartDate, // Effective date of the certificate
  207. IN LPFILETIME pftEndDate, // Termination date of the certificate
  208. OUT LPBYTE pbOutCert, // Buffer to receive the certificate
  209. IN OUT LPDWORD pcbCertLen); // Length of the pbCert buffer.
  210. extern PKCSDLLAPI BOOL WINAPI
  211. PkcsIssuerDistinguishedName(
  212. IN ISSUERHANDLE hIssuer, // The reference handle to the Issuer
  213. OUT LPTSTR szDname, // Buffer to receive the distinguished name
  214. IN OUT LPDWORD pcbDnameLen); // Length of pbCertReq buffer
  215. //
  216. // ?HOW? - How do we get the Issuer's UniqueIdentifier?
  217. // How do we attach X.509 v3 Extensions to the certificate?
  218. //
  219. //
  220. //==============================================================================
  221. //
  222. // CRL services.
  223. //
  224. typedef PKCSHANDLE
  225. CRLHANDLE; // Reference handle type.
  226. typedef CRLHANDLE
  227. *PCRLHANDLE, // Pointers to reference handles.
  228. *LPCRLHANDLE;
  229. extern PKCSDLLAPI BOOL WINAPI
  230. PkcsCrlCreate(
  231. OUT LPCRLHANDLE phCrl, // Handle for future reference
  232. IN ISSUERHANDLE hIssuer); // Handle of controlling issuer
  233. extern PKCSDLLAPI BOOL WINAPI
  234. PkcsCrlLoad(
  235. OUT LPCRLHANDLE phCrl, // Handle for future reference
  236. IN ISSUERHANDLE hIssuer, // Handle of controlling issuer
  237. IN const BYTE *pbCrl); // Buffer containing the CRL.
  238. extern PKCSDLLAPI BOOL WINAPI
  239. PkcsCrlRevoke(
  240. IN CRLHANDLE hCrl, // The reference handle to the CRL
  241. IN const BYTE *pbSerialNo, // Serial number of certificate to revoke
  242. IN DWORD cbSerialNoLen, // Length of the serial number
  243. IN LPFILETIME pfmStartDate); // Effective date of revokation
  244. extern PKCSDLLAPI BOOL WINAPI
  245. PkcsCrlIssue(
  246. IN CRLHANDLE hCrl, // The reference handle to the CRL
  247. IN LPFILETIME pftEndDate, // Termination date of the CRL
  248. OUT LPBYTE pbCrl, // Buffer to receive the CRL
  249. IN OUT LPDWORD pcbCrlLen); // Length of the pbCrl buffer
  250. extern PKCSDLLAPI BOOL WINAPI
  251. PkcsCrlClose(
  252. IN CRLHANDLE hCrl); // The reference handle to the Crl
  253. //
  254. // ?HOW? - How do we attach X.509 CRL v2 Extensions to the revokee?
  255. //
  256. //
  257. //==============================================================================
  258. //
  259. // Certificate services.
  260. //
  261. typedef PKCSHANDLE
  262. CERTIFICATEHANDLE; // Reference handle type.
  263. typedef CERTIFICATEHANDLE
  264. *PCERTIFICATEHANDLE, // Pointers to reference handles.
  265. *LPCERTIFICATEHANDLE;
  266. #define CERT_PKCSV1_INFO 1 // The type of Cert Info Struct following:
  267. //
  268. // Supported Certificate Types.
  269. //
  270. #define CERTYPE_UNKNOWN 0 // Unknown Certificate Type.
  271. #define CERTYPE_LOCAL_CA 1 // A local CA pointer.
  272. #define CERTYPE_X509 2 // An X.509 certificate.
  273. #define CERTYPE_PKCS_X509 3 // A PKCS & imbedded X.509 Certificate.
  274. #define CERTYPE_PKCS_REQUEST 4 // A PKCS Certificate Request (internal use)
  275. //
  276. // Supported Certificate Types.
  277. //
  278. // Local CA Specifics
  279. #define LCA_VERSION_1 0 // This Local CA is version 1.
  280. #define LCA_MAX_VERSION LCA_VERSION_1 // Max version supported.
  281. typedef struct {
  282. DWORD dwVersion; // The version of the local CA
  283. LPTSTR szSubject; // Address for Subject name
  284. DWORD cbSubjectLen; // Length of szSubject buffer
  285. LPTSTR szProvider; // Address for the provider name
  286. DWORD cbProviderLen; // Length of szProvider buffer
  287. DWORD dwProvType; // The type of Provider
  288. LPTSTR szKeyset; // Address for the keyset name
  289. DWORD cbKeysetLen; // Length of the szKeyset buffer
  290. DWORD dwKeySpec; // The specific key identifier
  291. } LOCALCACERTINFO, *PLOCALCACERTINFO, *LPLOCALCACERTINFO;
  292. // X.509 Certificate specifics
  293. #define X509_VERSION_1 0 // This certificate is X.509 version 1
  294. #define X509_VERSION_2 1 // This certificate is X.509 version 2
  295. #define X509_VERSION_3 2 // This certificate is X.509 version 3
  296. #define X509_MAX_VERSION X509_VERSION_1 // Max version supported.
  297. typedef struct {
  298. DWORD dwX509Version; // The version of the certificate
  299. LPBYTE pbSerialNumber; // Address for serial number.
  300. DWORD cbSerialNumLen; // Length of pbSerialNumber buffer.
  301. ALG_ID algId; // Algorithm Id.
  302. LPTSTR szIssuer; // Address for Issuer name
  303. DWORD cbIssuerLen; // Length of szIssuer buffer
  304. FILETIME ftNotBefore; // Certificate effective date
  305. FILETIME ftNotAfter; // Certificate expiration date
  306. LPTSTR szSubject; // Address for Subject name
  307. DWORD cbSubjectLen; // Length of szSubject buffer
  308. LPVOID pvIssuerUid; // Address for Issuer Id ?q?
  309. DWORD cbIssuerUidLen; // Length of pvIssuerUid buffer
  310. LPVOID pvSubjectUid; // Address for Subject Id ?q?
  311. DWORD cbSubjectUidLen; // Length of pvSubjectUid buffer
  312. EXTENSIONLISTHANDLE
  313. hExtensions; // Extension List handle
  314. } X509CERTINFO, *PX509CERTINFO, *LPX509CERTINFO;
  315. // PKCS-6 with embedded X.509 Certificate specifics
  316. #define PKCS_NOTUSED 0xffff // PKCS isn't used on this certificate
  317. #define PKCS_VERSION_1 0 // This certificate is PKCS version 1
  318. #define PKCS_MAX_VERSION PKCS_VERSION_1 // Max version supported.
  319. typedef struct {
  320. DWORD dwPKCSVersion; // The version of the certificate
  321. ATTRIBLISTHANDLE hAttributes; // Attribute list handle
  322. X509CERTINFO x509Info; // Info from the X.509 Certificate
  323. } PKCSX509CERTINFO, *PPKCSX509CERTINFO, *LPPKCSX509CERTINFO;
  324. // PKCS-10 Certificate Request Specifics
  325. typedef struct {
  326. DWORD dwPKCSVersion; // The version of the certificate request
  327. LPTSTR szSubject; // Address for Subject name
  328. DWORD cbSubjectLen; // Length of szSubject buffer
  329. ATTRIBLISTHANDLE hAttributes; // Attribute list handle
  330. } PKCSREQCERTINFO, *PPKCSREQCERTINFO, *LPPKCSREQCERTINFO;
  331. // Common Certificate Info Header.
  332. typedef struct {
  333. // This part is common to all certificate info structure types. (?Q?)
  334. DWORD cbStructLen; // Length of this structure
  335. WORD wCertInfoVersion; // The version (CERT_PKCSV1_INFO)
  336. WORD wCertInfoType; // The type of the following structure
  337. union {
  338. LOCALCACERTINFO localCA; // Local CA Characteristics
  339. X509CERTINFO x509; // X.509 Characteristics
  340. PKCSX509CERTINFO pkcs; // PKCS-6 Characteristics
  341. PKCSREQCERTINFO req; // PKCS-10 Request Characteristics
  342. } certInfo;
  343. } CERTIFICATEINFO, *PCERTIFICATEINFO, *LPCERTIFICATEINFO;
  344. // Crypto API Definitions
  345. #define CAPI_MAX_VERSION 2 // Supported version of CAPI.
  346. // Certificate Store Definitions
  347. #define CERTSTORE_NONE 0 // No store to be used.
  348. #define CERTSTORE_APPLICATION 1 // Store in application volatile memory
  349. #define CERTSTORE_CURRENT_USER 3 // Store in Registry under current user
  350. #define CERTSTORE_LOCAL_MACHINE 5 // Store in Registry under local machine
  351. // Certificate Warning Definitions
  352. #define CERTWARN_NOCRL 0x01 // At least one of the signing CAs didn't
  353. // have an associated CRL.
  354. #define CERTWARN_EARLYCRL 0x02 // At least one of the signing CAs had an
  355. // associated CRL who's issuing date was
  356. // in the future.
  357. #define CERTWARN_LATECRL 0x04 // At least one of the signing CAs had an
  358. // expired CRL.
  359. #define CERTWARN_TOBEREVOKED 0x08 // At least one of the signing CAs contained
  360. // a revocation for a certificate, but its
  361. // effective date has not yet been reached.
  362. extern PKCSDLLAPI BOOL WINAPI
  363. PkcsCertificateLoad(
  364. OUT LPCERTIFICATEHANDLE phCert, // Handle for future reference
  365. IN const BYTE *pbCert, // Buffer containing the certificate
  366. IN const BYTE *pbCrl, // Buffer containing any associated CRL
  367. IN OUT LPDWORD pdwType, // Certificate Type
  368. IN DWORD dwStore, // Which certificate store to load
  369. IN LPCTSTR szKeySet, // The name of the keyset to use
  370. IN LPCTSTR szProvider, // The specific name of the CSP to use
  371. IN DWORD dwProvType, // Provider type hint
  372. OUT LPBYTE szIssuerName, // The root or missing issuer
  373. IN OUT LPDWORD pcbIssuerLen, // Length of the szIssuerName buffer
  374. OUT LPDWORD pdwWarnings); // Receives warning flags.
  375. extern PKCSDLLAPI BOOL WINAPI
  376. PkcsCertificateOpen(
  377. OUT LPCERTIFICATEHANDLE phCert, // Handle for future reference
  378. IN LPCTSTR szSubjName, // Name of subject of existing certificate
  379. IN LPCTSTR szKeySet, // The name of the keyset to use
  380. IN LPCTSTR szProvider, // The specific name of the CSP to use
  381. IN DWORD dwProvType, // Provider type hint
  382. OUT LPDWORD pdwCertType, // Certificate Type
  383. IN OUT LPDWORD pfStore, // Certificate store search/found limits
  384. OUT LPTSTR szIssuerName, // The root or missing issuer
  385. IN OUT LPDWORD pcbIssuerLen, // Length of the szIssuerName buffer
  386. OUT LPDWORD pdwWarnings); // Receives warning flags.
  387. extern PKCSDLLAPI BOOL WINAPI
  388. PkcsCertificateUpdateCrl(
  389. IN CERTIFICATEHANDLE hCert, // The reference handle to the Certificate
  390. IN const BYTE *pbCrl); // Buffer containing the associated CRL
  391. extern PKCSDLLAPI BOOL WINAPI
  392. PkcsCertificateVerify(
  393. IN CERTIFICATEHANDLE hCert, // The reference handle to the Certificate
  394. IN const BYTE *pbData, // The data to be verified
  395. IN DWORD cbDataLen, // The length of the data to be signed
  396. IN LPCTSTR szComment, // Comment string associated with signature
  397. IN ALG_ID algId, // Algorithm suggestion
  398. IN const BYTE *pbSignature, // The supplied signature
  399. IN DWORD cbSigLen); // Length of the pbSignature buffer.
  400. extern PKCSDLLAPI BOOL WINAPI
  401. PkcsCertificateGetInfo(
  402. IN CERTIFICATEHANDLE hCert, // The reference handle to the Certificate
  403. IN OUT LPCERTIFICATEINFO pCertInfo); // The info structure to fill in
  404. extern PKCSDLLAPI BOOL WINAPI
  405. PkcsCertificateClose(
  406. IN CERTIFICATEHANDLE hCert); // The reference handle to the Certificate
  407. extern PKCSDLLAPI BOOL WINAPI
  408. PkcsCertificateDelete(
  409. IN CERTIFICATEHANDLE hCert); // The handle to the Certificate to remove
  410. #if defined(_MSVC) && defined(_DEBUG)
  411. //
  412. //==============================================================================
  413. //
  414. // Debugging extensions
  415. //
  416. extern PKCSDLLAPI void WINAPI
  417. PkcsMemoryClean(
  418. void);
  419. #endif
  420. //
  421. //==============================================================================
  422. //
  423. // Attribute Type definitions
  424. //
  425. #define X500_commonName TEXT("2.5.4.3")
  426. #define X500_surname TEXT("2.5.4.4")
  427. #define X500_serialNumber TEXT("2.5.4.5")
  428. #define X500_countryName TEXT("2.5.4.6")
  429. #define X500_locality TEXT("2.5.4.7")
  430. #define X500_stateOrProvinceName TEXT("2.5.4.8")
  431. #define X500_streetAddress TEXT("2.5.4.9")
  432. #define X500_organizationName TEXT("2.5.4.10")
  433. #define X500_orginazationalUnitName TEXT("2.5.4.11")
  434. #define X500_title TEXT("2.5.4.12")
  435. #define X500_description TEXT("2.5.4.13")
  436. #define X500_businessCategory TEXT("2.5.4.15")
  437. #define X500_postalCode TEXT("2.5.4.17")
  438. #define X500_postOfficeBox TEXT("2.5.4.18")
  439. #define X500_physicalDeliveryOfficeName TEXT("2.5.4.19")
  440. #define X500_telephoneNumber TEXT("2.5.4.20")
  441. #define X500_x121Address TEXT("2.5.4.24")
  442. #define X500_internationalISDNNumber TEXT("2.5.4.25")
  443. #define X500_destinationIndicator TEXT("2.5.4.27")
  444. #define PKCS1_md2 TEXT("1.2.840.113549.2.2")
  445. #define PKCS1_md4 TEXT("1.2.840.113549.2.4")
  446. #define PKCS1_md5 TEXT("1.2.840.113549.2.5")
  447. #define PKCS1_rsaEncryption TEXT("1.2.840.113549.1.1.1")
  448. #define PKCS1_md2WithRSAEncryption TEXT("1.2.840.113549.1.1.2")
  449. #define PKCS1_md4WithRSAEncryption TEXT("1.2.840.113549.1.1.3")
  450. #define PKCS1_md5WithRSAEncryption TEXT("1.2.840.113549.1.1.4")
  451. #define PKCS3_dhKeyAgreement TEXT("1.2.840.113549.1.3.1")
  452. #define PKCS5_pbeWithMD2AndDES_CBC TEXT("1.2.840.113549.1.5.1")
  453. #define PKCS5_pbeWithMD5AndDES_CBC TEXT("1.2.840.113549.1.5.3")
  454. #define PKCS7_data TEXT("1.2.840.113549.1.7.1")
  455. #define PKCS7_signedData TEXT("1.2.840.113549.1.7.2")
  456. #define PKCS7_envelopedData TEXT("1.2.840.113549.1.7.3")
  457. #define PKCS7_signedAndEnvelopedData TEXT("1.2.840.113549.1.7.4")
  458. #define PKCS7_digestedData TEXT("1.2.840.113549.1.7.5")
  459. #define PKCS7_encryptedData TEXT("1.2.840.113549.1.7.6")
  460. #define PKCS9_emailAddress TEXT("1.2.840.113549.1.9.1")
  461. #define PKCS9_unstructuredName TEXT("1.2.840.113549.1.9.2")
  462. #define PKCS9_contentType TEXT("1.2.840.113549.1.9.3")
  463. #define PKCS9_messageDigest TEXT("1.2.840.113549.1.9.4")
  464. #define PKCS9_signingTime TEXT("1.2.840.113549.1.9.5")
  465. #define PKCS9_countersignature TEXT("1.2.840.113549.1.9.6")
  466. #define PKCS9_challengePassword TEXT("1.2.840.113549.1.9.7")
  467. #define PKCS9_unstructuredAddress TEXT("1.2.840.113549.1.9.8")
  468. #define PKCS9_extendedCertificateAttributes TEXT("1.2.840.113549.1.9.9")
  469. #define PKCS9_description TEXT("1.2.840.113549.1.9.10")
  470. #ifdef _cplusplus
  471. }
  472. #endif
  473. #endif // _PKCSLIB_H_