This file is indexed.

/usr/i686-w64-mingw32/include/cryptxml.h is in mingw-w64-i686-dev 2.0.3-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
/**
 * This file has no copyright assigned and is placed in the Public Domain.
 * This file is part of the w64 mingw-runtime package.
 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
 */

#ifndef _INC_CRYPTXML
#define _INC_CRYPTXML

#ifdef __cplusplus
extern "C" {
#endif

#ifndef DECLSPEC_IMPORT
#define DECLSPEC_IMPORT __declspec(dllimport)
#endif

#ifndef CRYPTXMLAPI
#define CRYPTXMLAPI DECLSPEC_IMPORT
#endif

#ifndef __HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_DEFINED__
#define __HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_DEFINED__
/*Also in wincrypth*/
typedef ULONG_PTR HCRYPTPROV_OR_NCRYPT_KEY_HANDLE;
#endif /*__HCRYPTPROV_OR_NCRYPT_KEY_HANDLE_DEFINED__*/

#ifndef __BCRYPT_KEY_HANDLE_DEFINED__
#define __BCRYPT_KEY_HANDLE_DEFINED__
/*also in bcrypt.h*/
typedef LPVOID BCRYPT_KEY_HANDLE;
#endif /*__BCRYPT_KEY_HANDLE_DEFINED__*/

typedef HANDLE HCRYPTXML;

#if (_WIN32_WINNT >= 0x0601)

typedef enum tagCRYPT_XML_CHARSET {
  CRYPT_XML_CHARSET_AUTO      = 0,
  CRYPT_XML_CHARSET_UTF8      = 1,
  CRYPT_XML_CHARSET_UTF16LE   = 2,
  CRYPT_XML_CHARSET_UTF16BE   = 3 
} CRYPT_XML_CHARSET;

typedef enum tagCRYPT_XML_KEYINFO_SPEC {
  CRYPT_XML_KEYINFO_SPEC_NONE      = 0,
  CRYPT_XML_KEYINFO_SPEC_ENCODED   = 1,
  CRYPT_XML_KEYINFO_SPEC_PARAM     = 2 
} CRYPT_XML_KEYINFO_SPEC;

typedef enum tagCRYPT_XML_PROPERTY_ID {
  CRYPT_XML_PROPERTY_MAX_HEAP_SIZE        = 1,
  CRYPT_XML_PROPERTY_SIGNATURE_LOCATION   = 2,
  CRYPT_XML_PROPERTY_MAX_SIGNATURES       = 3,
  CRYPT_XML_PROPERTY_DOC_DECLARATION      = 4,
  CRYPT_XML_PROPERTY_XML_OUTPUT_CHARSET   = 5,
  CRYPT_XML_PROPERTY_HMAC_OUTPUT_LENGTH   = 6 
} CRYPT_XML_PROPERTY_ID;

typedef struct _CRYPT_XML_BLOB {
  CRYPT_XML_CHARSET dwCharset;
  ULONG             cbData;
  BYTE              *pbData;
} CRYPT_XML_BLOB, *PCRYPT_XML_BLOB;

#define CRYPT_XML_BLOB_MAX 0x7FFFFFF8

typedef struct _CRYPT_XML_ALGORITHM {
  ULONG          cbSize;
  LPCWSTR        wszAlgorithm;
  CRYPT_XML_BLOB Encoded;
} CRYPT_XML_ALGORITHM, *PCRYPT_XML_ALGORITHM;

typedef struct _CRYPT_XML_ALGORITHM_INFO {
  DWORD cbSize;
  WCHAR *wszAlgorithmURI;
  WCHAR *wszName;
  DWORD dwGroupId;
  WCHAR *wszCNGAlgid;
  WCHAR wszCNGExtraAlgid;
  DWORD dwSignFlags;
  DWORD dwVerifyFlags;
  void  pvPaddingInfo;
  void  pvExtraInfo;
} CRYPT_XML_ALGORITHM_INFO, *PCRYPT_XML_ALGORITHM_INFO;

#define CRYPT_XML_GROUP_ID_HASH 1
#define CRYPT_XML_GROUP_ID_SIGN 2

typedef HRESULT (CALLBACK *PFN_CRYPT_XML_WRITE_CALLBACK)(
  void *pvCallbackState,
  BYTE pbData,
  ULONG cbData
);

typedef HRESULT ( WINAPI *CryptXmlDllEncodeAlgorithm )(
  CRYPT_XML_ALGORITHM_INFO *pAlgInfo,
  CRYPT_XML_CHARSET dwCharset,
  void *pvCallbackState,
  PFN_CRYPT_XML_WRITE_CALLBACK pfnWrite
);

typedef HANDLE CRYPT_XML_DIGEST;

typedef HRESULT ( WINAPI *CryptXmlDllCreateDigest )(
  const CRYPT_XML_ALGORITHM *pDigestMethod,
  ULONG *pcbSize,
  CRYPT_XML_DIGEST *phDigest
);

typedef HRESULT ( WINAPI *CryptXmlDllDigestData )(
    CRYPT_XML_DIGEST hDigest,
    BYTE *pbData,
    ULONG cbDigest
);

typedef HRESULT ( WINAPI *CryptXmlDllFinalizeDigest )(
  CRYPT_XML_DIGEST hDigest,
  BYTE *pbDigest,
  ULONG cbDigest
);

typedef HRESULT ( WINAPI *CryptXmlDllCloseDigest )(
  CRYPT_XML_DIGEST hDigest
);

typedef HRESULT ( WINAPI *CryptXmlDllSignData )(
  const CRYPT_XML_ALGORITHM *pSignatureMethod,
  HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
  DWORD dwKeySpec,
  const BYTE *pbInput,
  ULONG cbInput,
  BYTE *pbOutput,
  ULONG cbOutput,
  ULONG *pcbResult
);

typedef HRESULT ( WINAPI *CryptXmlDllVerifySignature )(
  const CRYPT_XML_ALGORITHM *pSignatureMethod,
  HCRYPTXML_PROV hCryptProv,
  HCRYPTXML_KEY hKey,
  const BYTE *pbInput,
  ULONG cbInput,
  const BYTE *pbSignature,
  ULONG cbSignature
);

typedef HRESULT ( WINAPI *CryptXmlDllCreateKey )(
  CRYPT_XML_BLOB *pEncoded,
  const BCRYPT_KEY_HANDLE *phKey
);

typedef HRESULT ( WINAPI *CryptXmlDllEncodeKeyValue )(
  NCRYPT_KEY_HANDLE hKey,
  CRYPT_XML_CHARSET dwCharset,
  void *pvCallbackState,
  PFN_CRYPT_XML_WRITE_CALLBACK pfnWrite
);

typedef struct _CRYPT_XML_CRYPTOGRAPHIC_INTERFACE {
  ULONG                       cbSize;
  CryptXmlDllEncodeAlgorithm  fpCryptXmlEncodeAlgorithm;
  CryptXmlDllCreateDigest     fpCryptXmlCreateDigest;
  CryptXmlDllDigestData       fpCryptXmlDigestData;
  CryptXmlDllFinalizeDigest   fpCryptXmlFinalizeDigest;
  CryptXmlDllCloseDigest      fpCryptXmlCloseDigest;
  CryptXmlDllSignData         fpCryptXmlSignData;
  CryptXmlDllVerifySignature  fpCryptXmlVerifySignature;
  CryptXmlDllGetAlgorithmInfo fpCryptXmlGetAlgorithmInfo;
} CRYPT_XML_CRYPTOGRAPHIC_INTERFACE, *PCRYPT_XML_CRYPTOGRAPHIC_INTERFACE;

typedef HRESULT ( WINAPI *CryptXmlDllGetInterface )(
  DWORD dwFlags,
  const CRYPT_XML_ALGORITHM_INFO *pMethod,
  CRYPT_XML_CRYPTOGRAPHIC_INTERFACE *pInterface
);

typedef struct _CRYPT_XML_DATA_BLOB {
  ULONG cbData;
  BYTE  *pbData;
} CRYPT_XML_DATA_BLOB, *PCRYPT_XML_DATA_BLOB;

typedef HRESULT (CALLBACK *PFN_CRYPT_XML_DATA_PROVIDER_READ)(
  void *pvCallbackState,
  BYTE *pbData,
  ULONG cbData,
  ULONG *pcbRead
);

typedef HRESULT (CALLBACK *PFN_CRYPT_XML_DATA_PROVIDER_CLOSE)(
  void *pvCallbackState
);

typedef struct _CRYPT_XML_DATA_PROVIDER {
  void                              *pvCallbackState;
  ULONG                             cbBufferSize;
  PFN_CRYPT_XML_DATA_PROVIDER_READ  pfnRead;
  PFN_CRYPT_XML_DATA_PROVIDER_CLOSE pfnClose;
} CRYPT_XML_DATA_PROVIDER, *PCRYPT_XML_DATA_PROVIDER;

typedef HRESULT (CALLBACK *PFN_CRYPT_XML_CREATE_TRANSFORM)(
  const CRYPT_XML_ALGORITHM *pTransform,
  CRYPT_XML_DATA_PROVIDER *pProviderIn,
  CRYPT_XML_DATA_PROVIDER *pProviderOut
);

typedef struct _CRYPT_XML_TRANSFORM_INFO {
  ULONG                          cbSize;
  LPCWSTR                        wszAlgorithm;
  ULONG                          cbBufferSize;
  DWORD                          dwFlags;
  PFN_CRYPT_XML_CREATE_TRANSFORM pfnCreateTransform;
} CRYPT_XML_TRANSFORM_INFO, *PCRYPT_XML_TRANSFORM_INFO;

#define CRYPT_XML_TRANSFORM_ON_STREAM 0x00000001
#define CRYPT_XML_TRANSFORM_ON_NODESET 0x00000002
#define CRYPT_XML_TRANSFORM_URI_QUERY_STRING 0x00000003

typedef struct _CRYPT_XML_TRANSFORM_CHAIN_CONFIG {
  ULONG                     cbSize;
  ULONG                     cTransformInfo;
  PCRYPT_XML_TRANSFORM_INFO *rgpTransformInfo;
} CRYPT_XML_TRANSFORM_CHAIN_CONFIG, *PCRYPT_XML_TRANSFORM_CHAIN_CONFIG;

typedef struct _CRYPT_XML_REFERENCE {
  ULONG               cbSize;
  HCRYPTXML           hReference;
  LPCWSTR             wszId;
  LPCWSTR             wszUri;
  LPCWSTR             wszType;
  CRYPT_XML_ALGORITHM DigestMethod;
  CRYPT_DATA_BLOB     DigestValue;
  ULONG               cTransform;
  CRYPT_XML_ALGORITHM *rgTransform;
} CRYPT_XML_REFERENCE, *PCRYPT_XML_REFERENCE;

typedef struct _CRYPT_XML_REFERENCES {
  ULONG                cReference;
  PCRYPT_XML_REFERENCE *rgpReference;
} CRYPT_XML_REFERENCES, *PCRYPT_XML_REFERENCES;

typedef struct _CRYPT_XML_SIGNED_INFO {
  ULONG                cbSize;
  LPCWSTR              wszId;
  CRYPT_XML_ALGORITHM  Canonicalization;
  CRYPT_XML_ALGORITHM  SignatureMethod;
  ULONG                cReference;
  PCRYPT_XML_REFERENCE *rgpReference;
  CRYPT_XML_BLOB       Encoded;
} CRYPT_XML_SIGNED_INFO, *PCRYPT_XML_SIGNED_INFO;

typedef struct _CRYPT_XML_ISSUER_SERIAL {
  LPCWSTR wszIssuer ;
  LPCWSTR wszSerial;
} CRYPT_XML_ISSUER_SERIAL;

typedef struct _CRYPT_XML_X509DATA_ITEM {
  DWORD dwType;
  __C89_NAMELESS union {
    CRYPT_XML_ISSUER_SERIAL IssuerSerial;
    CRYPT_XML_DATA_BLOB     SKI;
    LPCWSTR                 wszSubjectName;
    CRYPT_XML_DATA_BLOB     Certificate;
    CRYPT_XML_DATA_BLOB     CRL;
    CRYPT_XML_BLOB          Custom;
  } ;
} CRYPT_XML_X509DATA_ITEM;

#define CRYPT_XML_X509DATA_TYPE_ISSUER_SERIAL 0x00000001
#define CRYPT_XML_X509DATA_TYPE_SKI 0x00000002
#define CRYPT_XML_X509DATA_TYPE_SUBJECT_NAME 0x00000003
#define CRYPT_XML_X509DATA_TYPE_CERTIFICATE 0x00000004
#define CRYPT_XML_X509DATA_TYPE_CRL 0x00000005
#define CRYPT_XML_X509DATA_TYPE_CUSTOM 0x00000006

typedef struct _CRYPT_XML_X509DATA {
  UINT                    cX509Data;
  CRYPT_XML_X509DATA_ITEM *rgX509Data;
} CRYPT_XML_X509DATA, *PCRYPT_XML_X509DATA;

typedef struct _CRYPT_XML_KEY_INFO_ITEM {
  DWORD dwType;
  __C89_NAMELESS union {
    LPCWSTR             wszKeyName;
    CRYPT_XML_KEY_VALUE KeyValue;
    CRYPT_XML_BLOB      RetrievalMethod;
    CRYPT_XML_X509DATA  X509Data;
    CRYPT_XML_BLOB      Custom;
  } ;
} CRYPT_XML_KEY_INFO_ITEM;

#define CRYPT_XML_KEYINFO_TYPE_KEYNAME 0x00000001
#define CRYPT_XML_KEYINFO_TYPE_KEYVALUE 0x00000002
#define CRYPT_XML_KEYINFO_TYPE_RETRIEVAL 0x00000003
#define CRYPT_XML_KEYINFO_TYPE_X509DATA 0x00000004
#define CRYPT_XML_KEYINFO_TYPE_CUSTOM 0x00000005

typedef struct _CRYPT_XML_KEY_DSA_KEY_VALUE {
  CRYPT_XML_DATA_BLOB P;
  CRYPT_XML_DATA_BLOB Q;
  CRYPT_XML_DATA_BLOB G;
  CRYPT_XML_DATA_BLOB Y;
  CRYPT_XML_DATA_BLOB J;
  CRYPT_XML_DATA_BLOB Seed;
  CRYPT_XML_DATA_BLOB Counter;
} CRYPT_XML_KEY_DSA_KEY_VALUE;

typedef struct _CRYPT_XML_KEY_RSA_KEY_VALUE {
  CRYPT_XML_DATA_BLOB Modulus;
  CRYPT_XML_DATA_BLOB Exponent;
} CRYPT_XML_KEY_RSA_KEY_VALUE;

typedef struct _CRYPT_XML_KEY_ECDSA_KEY_VALUE {
  LPCWSTR                  wszNamedCurve;
  CRYPT_XML_DATA_BLOB      X;
  CRYPT_XML_DATA_BLOB      Y;
  CRYPT_XML_BLOB           ExplicitPara;
} CRYPT_XML_KEY_ECDSA_KEY_VALUE;

typedef struct _CRYPT_XML_KEY_VALUE {
  DWORD dwType;
  __C89_NAMELESS union {
    CRYPT_XML_KEY_DSA_KEY_VALUE   DSAKeyValue;
    CRYPT_XML_KEY_RSA_KEY_VALUE   RSAKeyValue;
    CRYPT_XML_KEY_ECDSA_KEY_VALUE ECDSAKeyValue;
    CRYPT_XML_BLOB                Custom;
  } ;
} CRYPT_XML_KEY_VALUE;

#define CRYPT_XML_KEY_VALUE_TYPE_DSA 0x00000001
#define CRYPT_XML_KEY_VALUE_TYPE_RSA 0x00000002
#define CRYPT_XML_KEY_VALUE_TYPE_ECDSA 0x00000003
#define CRYPT_XML_KEY_VALUE_TYPE_CUSTOM 0x00000004

typedef struct _CRYPT_XML_KEY_INFO {
  ULONG                   cbSize;
  LPCWSTR                 wszId;
  UINT                    cKeyInfo;
  CRYPT_XML_KEY_INFO_ITEM *rgKeyInfo;
  BCRYPT_KEY_HANDLE       hVerifyKey;
} CRYPT_XML_KEY_INFO;

typedef struct _CRYPT_XML_OBJECT {
  ULONG                cbSize;
  HCRYPTXML            hObject;
  LPCWSTR              wszId;
  LPCWSTR              wszMimeType;
  LPCWSTR              wszEncoding;
  CRYPT_XML_REFERENCES Manifest;
  CRYPT_XML_BLOB       Encoded;
} CRYPT_XML_OBJECT, *PCRYPT_XML_OBJECT;

typedef struct _CRYPT_XML_SIGNATURE {
  ULONG                 cbSize;
  HCRYPTXML             hSignature;
  LPCWSTR               wszId;
  CRYPT_XML_SIGNED_INFO SignedInfo;
  CRYPT_DATA_BLOB       SignatureValue;
  CRYPT_XML_KEY_INFO    *pKeyInfo;
  ULONG                 cObject;
  PCRYPT_XML_OBJECT     *rgpObject;
} CRYPT_XML_SIGNATURE, *PCRYPT_XML_SIGNATURE;

typedef struct _CRYPT_XML_DOC_CTXT {
  ULONG                            cbSize;
  HCRYPTXML                        hDocCtxt;
  CRYPT_XML_TRANSFORM_CHAIN_CONFIG *pTransformsConfig;
  ULONG                            cSignature;
  PCRYPT_XML_SIGNATURE             *rgpSignature;
} CRYPT_XML_DOC_CTXT, *PCRYPT_XML_DOC_CTXT;

typedef struct _CRYPT_XML_KEYINFO_PARAM {
  LPCWSTR   wszId;
  LPCWSTR   wszKeyName;
  CERT_BLOB SKI;
  LPCWSTR   wszSubjectName;
  ULONG     cCertificate;
  CERT_BLOB *rgCertificate;
  ULONG     cCRL;
  CERT_BLOB *rgCRL;
} CRYPT_XML_KEYINFO_PARAM;

typedef struct _CRYPT_XML_PROPERTY {
  CRYPT_XML_PROPERTY_ID dwPropId;
  const void            *pvValue;
  ULONG                 cbValue;
} CRYPT_XML_PROPERTY, *PCRYPT_XML_PROPERTY;

typedef struct _CRYPT_XML_STATUS {
  ULONG cbSize;
  DWORD dwErrorStatus;
  DWORD dwInfoStatus;
} CRYPT_XML_STATUS, *PCRYPT_XML_STATUS;

#define CRYPT_XML_STATUS_ERROR_NOT_RESOLVED 0x00000001
#define CRYPT_XML_STATUS_ERROR_DIGEST_INVALID 0x00000002
#define CRYPT_XML_STATUS_ERROR_NOT_SUPPORTED_ALGORITHM 0x00000005
#define CRYPT_XML_STATUS_ERROR_NOT_SUPPORTED_TRANSFORM 0x00000008
#define CRYPT_XML_STATUS_ERROR_SIGNATURE_INVALID 0x00010000
#define CRYPT_XML_STATUS_ERROR_KEYINFO_NOT_PARSED 0x00020000

#define CRYPT_XML_STATUS_INTERNAL_REFERENCE 0x00000001
#define CRYPT_XML_STATUS_KEY_AVAILABLE 0x00000002
#define CRYPT_XML_STATUS_DIGESTING 0x00000004
#define CRYPT_XML_STATUS_DIGEST_VALID 0x00000008
#define CRYPT_XML_STATUS_SIGNATURE_VALID 0x00010000
#define CRYPT_XML_STATUS_OPENED_TO_ENCODE 0x80000000

CRYPTXMLAPI HRESULT WINAPI CryptXmlAddObject(
  HCRYPTXML hSignatureOrObject,
  DWORD dwFlags,
  const CRYPT_XML_PROPERTY *rgProperty,
  ULONG cProperty,
  const PCRYPT_XML_BLOB pEncoded,
  const CRYPT_XML_OBJECT **ppObject
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlClose(
  HCRYPTXML hCryptXml
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlCreateReference(
  HCRYPTXML hCryptXml,
  DWORD dwFlags,
  LPCWSTR wszId,
  LPCWSTR wszURI,
  LPCWSTR wszType,
  const CRYPT_XML_ALGORITHM *pDigestMethod,
  ULONG cTransform,
  const CRYPT_XML_ALGORITHM *rgTransform,
  HCRYPTXML *phReference
);

#define CRYPT_XML_FLAG_CREATE_REFERENCE_AS_OBJECT 0x00000001

CRYPTXMLAPI HRESULT WINAPI CryptXmlDigestReference(
  HCRYPTXML hReference,
  DWORD dwFlags,
  CRYPT_XML_DATA_PROVIDER *pDataProviderIn
);

#define CRYPT_XML_REFERENCE_DATA_TRANSFORMED 0x00000001

CRYPTXMLAPI HRESULT WINAPI CryptXmlEncode(
  HCRYPTXML hCryptXml,
  CRYPT_XML_CHARSET dwCharset,
  const CRYPT_XML_PROPERTY *rgProperty,
  ULONG cProperty,
  void *pvCallbackState,
  PFN_CRYPT_XML_WRITE_CALLBACK pfnWrite
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlGetAlgorithmInfo(
  const CRYPT_XML_ALGORITHM *pXmlAlgorithm,
  DWORD dwFlags,
  CRYPT_XML_ALGORITHM_INFO **ppAlgInfo
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlGetDocContext(
  HCRYPTXML hCryptXml,
  const CRYPT_XML_DOC_CTXT **ppStruct
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlGetReference(
  HCRYPTXML HCRYPTXML,
  const CRYPT_XML_REFERENCE **ppStruct
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlGetSignature(
  HCRYPTXML hCryptXml,
  const PCRYPT_XML_SIGNATURE **ppStruct
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlGetStatus(
  HCRYPTXML hCryptXml,
  CRYPT_XML_STATUS *pStatus
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlGetTransforms(
  PCRYPT_XML_TRANSFORM_CHAIN_CONFIG **pConfig
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlImportPublicKey(
  DWORD dwFlags,
  CRYPT_XML_KEY_VALUE *pKeyValue,
  BCRYPT_KEY_HANDLE *phKey
);

#define CRYPT_XML_FLAG_DISABLE_EXTENSIONS 0x10000000

CRYPTXMLAPI HRESULT WINAPI CryptXmlOpenToDecode(
  CRYPT_XML_TRANSFORM_CHAIN_CONFIG *pConfig,
  DWORD dwFlags,
  const CRYPT_XML_PROPERTY *rgProperty,
  ULONG cProperty,
  const CRYPT_XML_BLOB *pEncoded,
  HCRYPTXML phCryptXml
);

#define CRYPT_XML_FLAG_NO_SERIALIZE 0x80000000
#define CRYPT_XML_FLAG_DISABLE_EXTENSION 0x10000000

CRYPTXMLAPI HRESULT WINAPI CryptXmlOpenToEncode(
  CRYPT_XML_TRANSFORM_CHAIN_CONFIG *pConfig,
  DWORD dwFlags,
  LPCWSTR wszId,
  CRYPT_XML_PROPERTY *rgProperty,
  ULONG cProperty,
  CRYPT_XML_BLOB *pEncoded,
  HCRYPTXML *phSignature
);

#define CRYPT_XML_FLAG_NO_SERIALIZE 0x80000000
#define CRYPT_XML_FLAG_DISABLE_EXTENSIONS 0x10000000

CRYPTXMLAPI HRESULT WINAPI CryptXmlSetHMACSecret(
  HCRYPTXML hSignature,
  const BYTE *pbSecret,
  ULONG cbSecret
);

CRYPTXMLAPI HRESULT WINAPI CryptXmlSign(
  HCRYPTXML hSignature,
  HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hKey,
  DWORD dwKeySpec,
  DWORD dwFlags,
  CRYPT_XML_KEYINFO_SPEC dwKeyInfoSpec,
  const void pvKeyInfoSpec,
  const CRYPT_XML_ALGORITHM pSignatureMethod,
  const CRYPT_XML_ALGORITHM pCanonicalization
);

#define AT_KEYEXCHANGE 1
#define AT_SIGNATURE 2
#define CERT_NCRYPT_KEY_SPEC 0xFFFFFFFF

#define CRYPT_XML_SIGN_ADD_KEYVALUE 0x00000001
#define CRYPT_XML_FLAG_DISABLE_EXTENSIONS 0x10000000

CRYPTXMLAPI HRESULT WINAPI CryptXmlVerifySignature(
  HCRYPTXML hSignature,
  BCRYPT_KEY_HANDLE hKey,
  DWORD dwFlags
);

#endif /*(_WIN32_WINNT >= 0x0601)*/

#ifdef __cplusplus
}
#endif
#endif /*_INC_CRYPTXML*/