This file is indexed.

/usr/include/thunderbird/nsIX509CertDB.h is in thunderbird-dev 1:52.8.0-1~deb8u1.

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
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIX509CertDB.idl
 */

#ifndef __gen_nsIX509CertDB_h__
#define __gen_nsIX509CertDB_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIArray; /* forward declaration */

class nsIX509Cert; /* forward declaration */

class nsIFile; /* forward declaration */

class nsIInterfaceRequestor; /* forward declaration */

class nsIZipReader; /* forward declaration */

class nsIX509CertList; /* forward declaration */

class nsIInputStream; /* forward declaration */

#define NS_X509CERTDB_CONTRACTID "@mozilla.org/security/x509certdb;1"
typedef uint32_t  AppTrustedRoot;


/* starting interface:    nsIOpenSignedAppFileCallback */
#define NS_IOPENSIGNEDAPPFILECALLBACK_IID_STR "fc2b60e5-9a07-47c2-a2cd-b83b68a660ac"

#define NS_IOPENSIGNEDAPPFILECALLBACK_IID \
  {0xfc2b60e5, 0x9a07, 0x47c2, \
    { 0xa2, 0xcd, 0xb8, 0x3b, 0x68, 0xa6, 0x60, 0xac }}

class NS_NO_VTABLE nsIOpenSignedAppFileCallback : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOPENSIGNEDAPPFILECALLBACK_IID)

  /* void openSignedAppFileFinished (in nsresult rv, in nsIZipReader aZipReader, in nsIX509Cert aSignerCert); */
  NS_IMETHOD OpenSignedAppFileFinished(nsresult rv, nsIZipReader *aZipReader, nsIX509Cert *aSignerCert) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIOpenSignedAppFileCallback, NS_IOPENSIGNEDAPPFILECALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIOPENSIGNEDAPPFILECALLBACK \
  NS_IMETHOD OpenSignedAppFileFinished(nsresult rv, nsIZipReader *aZipReader, nsIX509Cert *aSignerCert) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIOPENSIGNEDAPPFILECALLBACK \
  NS_METHOD OpenSignedAppFileFinished(nsresult rv, nsIZipReader *aZipReader, nsIX509Cert *aSignerCert); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIOPENSIGNEDAPPFILECALLBACK(_to) \
  NS_IMETHOD OpenSignedAppFileFinished(nsresult rv, nsIZipReader *aZipReader, nsIX509Cert *aSignerCert) override { return _to OpenSignedAppFileFinished(rv, aZipReader, aSignerCert); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIOPENSIGNEDAPPFILECALLBACK(_to) \
  NS_IMETHOD OpenSignedAppFileFinished(nsresult rv, nsIZipReader *aZipReader, nsIX509Cert *aSignerCert) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenSignedAppFileFinished(rv, aZipReader, aSignerCert); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsOpenSignedAppFileCallback : public nsIOpenSignedAppFileCallback
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOPENSIGNEDAPPFILECALLBACK

  nsOpenSignedAppFileCallback();

private:
  ~nsOpenSignedAppFileCallback();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsOpenSignedAppFileCallback, nsIOpenSignedAppFileCallback)

nsOpenSignedAppFileCallback::nsOpenSignedAppFileCallback()
{
  /* member initializers and constructor code */
}

nsOpenSignedAppFileCallback::~nsOpenSignedAppFileCallback()
{
  /* destructor code */
}

/* void openSignedAppFileFinished (in nsresult rv, in nsIZipReader aZipReader, in nsIX509Cert aSignerCert); */
NS_IMETHODIMP nsOpenSignedAppFileCallback::OpenSignedAppFileFinished(nsresult rv, nsIZipReader *aZipReader, nsIX509Cert *aSignerCert)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


/* starting interface:    nsIVerifySignedDirectoryCallback */
#define NS_IVERIFYSIGNEDDIRECTORYCALLBACK_IID_STR "d5f97827-622a-488f-be08-d850432ac8ec"

#define NS_IVERIFYSIGNEDDIRECTORYCALLBACK_IID \
  {0xd5f97827, 0x622a, 0x488f, \
    { 0xbe, 0x08, 0xd8, 0x50, 0x43, 0x2a, 0xc8, 0xec }}

class NS_NO_VTABLE nsIVerifySignedDirectoryCallback : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IVERIFYSIGNEDDIRECTORYCALLBACK_IID)

  /* void verifySignedDirectoryFinished (in nsresult rv, in nsIX509Cert aSignerCert); */
  NS_IMETHOD VerifySignedDirectoryFinished(nsresult rv, nsIX509Cert *aSignerCert) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIVerifySignedDirectoryCallback, NS_IVERIFYSIGNEDDIRECTORYCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIVERIFYSIGNEDDIRECTORYCALLBACK \
  NS_IMETHOD VerifySignedDirectoryFinished(nsresult rv, nsIX509Cert *aSignerCert) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIVERIFYSIGNEDDIRECTORYCALLBACK \
  NS_METHOD VerifySignedDirectoryFinished(nsresult rv, nsIX509Cert *aSignerCert); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIVERIFYSIGNEDDIRECTORYCALLBACK(_to) \
  NS_IMETHOD VerifySignedDirectoryFinished(nsresult rv, nsIX509Cert *aSignerCert) override { return _to VerifySignedDirectoryFinished(rv, aSignerCert); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIVERIFYSIGNEDDIRECTORYCALLBACK(_to) \
  NS_IMETHOD VerifySignedDirectoryFinished(nsresult rv, nsIX509Cert *aSignerCert) override { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifySignedDirectoryFinished(rv, aSignerCert); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsVerifySignedDirectoryCallback : public nsIVerifySignedDirectoryCallback
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIVERIFYSIGNEDDIRECTORYCALLBACK

  nsVerifySignedDirectoryCallback();

private:
  ~nsVerifySignedDirectoryCallback();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsVerifySignedDirectoryCallback, nsIVerifySignedDirectoryCallback)

nsVerifySignedDirectoryCallback::nsVerifySignedDirectoryCallback()
{
  /* member initializers and constructor code */
}

nsVerifySignedDirectoryCallback::~nsVerifySignedDirectoryCallback()
{
  /* destructor code */
}

/* void verifySignedDirectoryFinished (in nsresult rv, in nsIX509Cert aSignerCert); */
NS_IMETHODIMP nsVerifySignedDirectoryCallback::VerifySignedDirectoryFinished(nsresult rv, nsIX509Cert *aSignerCert)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


/* starting interface:    nsIVerifySignedManifestCallback */
#define NS_IVERIFYSIGNEDMANIFESTCALLBACK_IID_STR "3d6a9c87-5c5f-46fc-9410-96da6092f0f2"

#define NS_IVERIFYSIGNEDMANIFESTCALLBACK_IID \
  {0x3d6a9c87, 0x5c5f, 0x46fc, \
    { 0x94, 0x10, 0x96, 0xda, 0x60, 0x92, 0xf0, 0xf2 }}

class NS_NO_VTABLE nsIVerifySignedManifestCallback : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IVERIFYSIGNEDMANIFESTCALLBACK_IID)

  /* void verifySignedManifestFinished (in nsresult rv, in nsIX509Cert aSignerCert); */
  NS_IMETHOD VerifySignedManifestFinished(nsresult rv, nsIX509Cert *aSignerCert) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIVerifySignedManifestCallback, NS_IVERIFYSIGNEDMANIFESTCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIVERIFYSIGNEDMANIFESTCALLBACK \
  NS_IMETHOD VerifySignedManifestFinished(nsresult rv, nsIX509Cert *aSignerCert) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIVERIFYSIGNEDMANIFESTCALLBACK \
  NS_METHOD VerifySignedManifestFinished(nsresult rv, nsIX509Cert *aSignerCert); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIVERIFYSIGNEDMANIFESTCALLBACK(_to) \
  NS_IMETHOD VerifySignedManifestFinished(nsresult rv, nsIX509Cert *aSignerCert) override { return _to VerifySignedManifestFinished(rv, aSignerCert); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIVERIFYSIGNEDMANIFESTCALLBACK(_to) \
  NS_IMETHOD VerifySignedManifestFinished(nsresult rv, nsIX509Cert *aSignerCert) override { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifySignedManifestFinished(rv, aSignerCert); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsVerifySignedManifestCallback : public nsIVerifySignedManifestCallback
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIVERIFYSIGNEDMANIFESTCALLBACK

  nsVerifySignedManifestCallback();

private:
  ~nsVerifySignedManifestCallback();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsVerifySignedManifestCallback, nsIVerifySignedManifestCallback)

nsVerifySignedManifestCallback::nsVerifySignedManifestCallback()
{
  /* member initializers and constructor code */
}

nsVerifySignedManifestCallback::~nsVerifySignedManifestCallback()
{
  /* destructor code */
}

/* void verifySignedManifestFinished (in nsresult rv, in nsIX509Cert aSignerCert); */
NS_IMETHODIMP nsVerifySignedManifestCallback::VerifySignedManifestFinished(nsresult rv, nsIX509Cert *aSignerCert)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


/* starting interface:    nsICertVerificationCallback */
#define NS_ICERTVERIFICATIONCALLBACK_IID_STR "49e16fc8-efac-4f57-8361-956ef6b960a4"

#define NS_ICERTVERIFICATIONCALLBACK_IID \
  {0x49e16fc8, 0xefac, 0x4f57, \
    { 0x83, 0x61, 0x95, 0x6e, 0xf6, 0xb9, 0x60, 0xa4 }}

class NS_NO_VTABLE nsICertVerificationCallback : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICERTVERIFICATIONCALLBACK_IID)

  /* void verifyCertFinished (in int32_t aPRErrorCode, in nsIX509CertList aVerifiedChain, in bool aHasEVPolicy); */
  NS_IMETHOD VerifyCertFinished(int32_t aPRErrorCode, nsIX509CertList *aVerifiedChain, bool aHasEVPolicy) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsICertVerificationCallback, NS_ICERTVERIFICATIONCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICERTVERIFICATIONCALLBACK \
  NS_IMETHOD VerifyCertFinished(int32_t aPRErrorCode, nsIX509CertList *aVerifiedChain, bool aHasEVPolicy) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSICERTVERIFICATIONCALLBACK \
  NS_METHOD VerifyCertFinished(int32_t aPRErrorCode, nsIX509CertList *aVerifiedChain, bool aHasEVPolicy); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICERTVERIFICATIONCALLBACK(_to) \
  NS_IMETHOD VerifyCertFinished(int32_t aPRErrorCode, nsIX509CertList *aVerifiedChain, bool aHasEVPolicy) override { return _to VerifyCertFinished(aPRErrorCode, aVerifiedChain, aHasEVPolicy); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICERTVERIFICATIONCALLBACK(_to) \
  NS_IMETHOD VerifyCertFinished(int32_t aPRErrorCode, nsIX509CertList *aVerifiedChain, bool aHasEVPolicy) override { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifyCertFinished(aPRErrorCode, aVerifiedChain, aHasEVPolicy); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsCertVerificationCallback : public nsICertVerificationCallback
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSICERTVERIFICATIONCALLBACK

  nsCertVerificationCallback();

private:
  ~nsCertVerificationCallback();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsCertVerificationCallback, nsICertVerificationCallback)

nsCertVerificationCallback::nsCertVerificationCallback()
{
  /* member initializers and constructor code */
}

nsCertVerificationCallback::~nsCertVerificationCallback()
{
  /* destructor code */
}

/* void verifyCertFinished (in int32_t aPRErrorCode, in nsIX509CertList aVerifiedChain, in bool aHasEVPolicy); */
NS_IMETHODIMP nsCertVerificationCallback::VerifyCertFinished(int32_t aPRErrorCode, nsIX509CertList *aVerifiedChain, bool aHasEVPolicy)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


/* starting interface:    nsIX509CertDB */
#define NS_IX509CERTDB_IID_STR "5c16cd9b-5a73-47f1-ab0f-11ede7495cce"

#define NS_IX509CERTDB_IID \
  {0x5c16cd9b, 0x5a73, 0x47f1, \
    { 0xab, 0x0f, 0x11, 0xed, 0xe7, 0x49, 0x5c, 0xce }}

class NS_NO_VTABLE nsIX509CertDB : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IX509CERTDB_IID)

  enum {
    UNTRUSTED = 0U,
    TRUSTED_SSL = 1U,
    TRUSTED_EMAIL = 2U,
    TRUSTED_OBJSIGN = 4U
  };

  /* nsIX509Cert findCertByNickname (in AString aNickname); */
  NS_IMETHOD FindCertByNickname(const nsAString & aNickname, nsIX509Cert * *_retval) = 0;

  /* nsIX509Cert findCertByDBKey (in string aDBkey); */
  NS_IMETHOD FindCertByDBKey(const char * aDBkey, nsIX509Cert * *_retval) = 0;

  /* nsIX509Cert findEmailEncryptionCert (in AString aNickname); */
  NS_IMETHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert * *_retval) = 0;

  /* nsIX509Cert findEmailSigningCert (in AString aNickname); */
  NS_IMETHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert * *_retval) = 0;

  /* nsIX509Cert findCertByEmailAddress (in string aEmailAddress); */
  NS_IMETHOD FindCertByEmailAddress(const char * aEmailAddress, nsIX509Cert * *_retval) = 0;

  /* void importCertificates ([array, size_is (length)] in octet data, in unsigned long length, in unsigned long type, in nsIInterfaceRequestor ctx); */
  NS_IMETHOD ImportCertificates(uint8_t *data, uint32_t length, uint32_t type, nsIInterfaceRequestor *ctx) = 0;

  /* void importEmailCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
  NS_IMETHOD ImportEmailCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx) = 0;

  /* void importUserCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
  NS_IMETHOD ImportUserCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx) = 0;

  /* void deleteCertificate (in nsIX509Cert aCert); */
  NS_IMETHOD DeleteCertificate(nsIX509Cert *aCert) = 0;

  /* void setCertTrust (in nsIX509Cert cert, in unsigned long type, in unsigned long trust); */
  NS_IMETHOD SetCertTrust(nsIX509Cert *cert, uint32_t type, uint32_t trust) = 0;

  /* void setCertTrustFromString (in nsIX509Cert cert, in ACString trustString); */
  NS_IMETHOD SetCertTrustFromString(nsIX509Cert *cert, const nsACString & trustString) = 0;

  /* boolean isCertTrusted (in nsIX509Cert cert, in unsigned long certType, in unsigned long trustType); */
  NS_IMETHOD IsCertTrusted(nsIX509Cert *cert, uint32_t certType, uint32_t trustType, bool *_retval) = 0;

  /* void importCertsFromFile (in nsIFile aFile, in unsigned long aType); */
  NS_IMETHOD ImportCertsFromFile(nsIFile *aFile, uint32_t aType) = 0;

  /* void importPKCS12File (in nsISupports aToken, in nsIFile aFile); */
  NS_IMETHOD ImportPKCS12File(nsISupports *aToken, nsIFile *aFile) = 0;

  /* void exportPKCS12File (in nsISupports aToken, in nsIFile aFile, in unsigned long count, [array, size_is (count)] in nsIX509Cert aCerts); */
  NS_IMETHOD ExportPKCS12File(nsISupports *aToken, nsIFile *aFile, uint32_t count, nsIX509Cert **aCerts) = 0;

  /* nsIX509Cert constructX509FromBase64 (in ACString base64); */
  NS_IMETHOD ConstructX509FromBase64(const nsACString & base64, nsIX509Cert * *_retval) = 0;

  /* nsIX509Cert constructX509 (in string certDER, in unsigned long length); */
  NS_IMETHOD ConstructX509(const char * certDER, uint32_t length, nsIX509Cert * *_retval) = 0;

  enum {
    AppMarketplaceProdPublicRoot = 1U,
    AppMarketplaceProdReviewersRoot = 2U,
    AppMarketplaceDevPublicRoot = 3U,
    AppMarketplaceDevReviewersRoot = 4U,
    AppMarketplaceStageRoot = 5U,
    AppXPCShellRoot = 6U,
    AddonsPublicRoot = 7U,
    AddonsStageRoot = 8U,
    PrivilegedPackageRoot = 9U,
    DeveloperImportedRoot = 10U
  };

  /* void openSignedAppFileAsync (in AppTrustedRoot trustedRoot, in nsIFile aJarFile, in nsIOpenSignedAppFileCallback callback); */
  NS_IMETHOD OpenSignedAppFileAsync(AppTrustedRoot trustedRoot, nsIFile *aJarFile, nsIOpenSignedAppFileCallback *callback) = 0;

  /* void verifySignedDirectoryAsync (in AppTrustedRoot trustedRoot, in nsIFile aUnpackedDir, in nsIVerifySignedDirectoryCallback callback); */
  NS_IMETHOD VerifySignedDirectoryAsync(AppTrustedRoot trustedRoot, nsIFile *aUnpackedDir, nsIVerifySignedDirectoryCallback *callback) = 0;

  /* void verifySignedManifestAsync (in AppTrustedRoot trustedRoot, in nsIInputStream aManifestStream, in nsIInputStream aSignatureStream, in nsIVerifySignedManifestCallback callback); */
  NS_IMETHOD VerifySignedManifestAsync(AppTrustedRoot trustedRoot, nsIInputStream *aManifestStream, nsIInputStream *aSignatureStream, nsIVerifySignedManifestCallback *callback) = 0;

  /* void addCert (in ACString certDER, in ACString aTrust, in AUTF8String aName); */
  NS_IMETHOD AddCert(const nsACString & certDER, const nsACString & aTrust, const nsACString & aName) = 0;

  enum {
    FLAG_LOCAL_ONLY = 1U,
    FLAG_MUST_BE_EV = 2U
  };

  /* int32_t verifyCertAtTime (in nsIX509Cert aCert, in int64_t aUsage, in uint32_t aFlags, in string aHostname, in uint64_t aTime, out nsIX509CertList aVerifiedChain, out bool aHasEVPolicy); */
  NS_IMETHOD VerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval) = 0;

  /* int32_t verifyCertNow (in nsIX509Cert aCert, in int64_t aUsage, in uint32_t aFlags, in string aHostname, out nsIX509CertList aVerifiedChain, out bool aHasEVPolicy); */
  NS_IMETHOD VerifyCertNow(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval) = 0;

  /* void asyncVerifyCertAtTime (in nsIX509Cert aCert, in int64_t aUsage, in uint32_t aFlags, in string aHostname, in uint64_t aTime, in nsICertVerificationCallback aCallback); */
  NS_IMETHOD AsyncVerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsICertVerificationCallback *aCallback) = 0;

  /* void clearOCSPCache (); */
  NS_IMETHOD ClearOCSPCache(void) = 0;

  /* void addCertFromBase64 (in ACString base64, in ACString aTrust, in AUTF8String aName); */
  NS_IMETHOD AddCertFromBase64(const nsACString & base64, const nsACString & aTrust, const nsACString & aName) = 0;

  /* nsIX509CertList getCerts (); */
  NS_IMETHOD GetCerts(nsIX509CertList * *_retval) = 0;

  /* nsIX509CertList getEnterpriseRoots (); */
  NS_IMETHOD GetEnterpriseRoots(nsIX509CertList * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIX509CertDB, NS_IX509CERTDB_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIX509CERTDB \
  NS_IMETHOD FindCertByNickname(const nsAString & aNickname, nsIX509Cert * *_retval) override; \
  NS_IMETHOD FindCertByDBKey(const char * aDBkey, nsIX509Cert * *_retval) override; \
  NS_IMETHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert * *_retval) override; \
  NS_IMETHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert * *_retval) override; \
  NS_IMETHOD FindCertByEmailAddress(const char * aEmailAddress, nsIX509Cert * *_retval) override; \
  NS_IMETHOD ImportCertificates(uint8_t *data, uint32_t length, uint32_t type, nsIInterfaceRequestor *ctx) override; \
  NS_IMETHOD ImportEmailCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx) override; \
  NS_IMETHOD ImportUserCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx) override; \
  NS_IMETHOD DeleteCertificate(nsIX509Cert *aCert) override; \
  NS_IMETHOD SetCertTrust(nsIX509Cert *cert, uint32_t type, uint32_t trust) override; \
  NS_IMETHOD SetCertTrustFromString(nsIX509Cert *cert, const nsACString & trustString) override; \
  NS_IMETHOD IsCertTrusted(nsIX509Cert *cert, uint32_t certType, uint32_t trustType, bool *_retval) override; \
  NS_IMETHOD ImportCertsFromFile(nsIFile *aFile, uint32_t aType) override; \
  NS_IMETHOD ImportPKCS12File(nsISupports *aToken, nsIFile *aFile) override; \
  NS_IMETHOD ExportPKCS12File(nsISupports *aToken, nsIFile *aFile, uint32_t count, nsIX509Cert **aCerts) override; \
  NS_IMETHOD ConstructX509FromBase64(const nsACString & base64, nsIX509Cert * *_retval) override; \
  NS_IMETHOD ConstructX509(const char * certDER, uint32_t length, nsIX509Cert * *_retval) override; \
  NS_IMETHOD OpenSignedAppFileAsync(AppTrustedRoot trustedRoot, nsIFile *aJarFile, nsIOpenSignedAppFileCallback *callback) override; \
  NS_IMETHOD VerifySignedDirectoryAsync(AppTrustedRoot trustedRoot, nsIFile *aUnpackedDir, nsIVerifySignedDirectoryCallback *callback) override; \
  NS_IMETHOD VerifySignedManifestAsync(AppTrustedRoot trustedRoot, nsIInputStream *aManifestStream, nsIInputStream *aSignatureStream, nsIVerifySignedManifestCallback *callback) override; \
  NS_IMETHOD AddCert(const nsACString & certDER, const nsACString & aTrust, const nsACString & aName) override; \
  NS_IMETHOD VerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval) override; \
  NS_IMETHOD VerifyCertNow(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval) override; \
  NS_IMETHOD AsyncVerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsICertVerificationCallback *aCallback) override; \
  NS_IMETHOD ClearOCSPCache(void) override; \
  NS_IMETHOD AddCertFromBase64(const nsACString & base64, const nsACString & aTrust, const nsACString & aName) override; \
  NS_IMETHOD GetCerts(nsIX509CertList * *_retval) override; \
  NS_IMETHOD GetEnterpriseRoots(nsIX509CertList * *_retval) override; 

/* Use this macro when declaring the members of this interface when the
   class doesn't implement the interface. This is useful for forwarding. */
#define NS_DECL_NON_VIRTUAL_NSIX509CERTDB \
  NS_METHOD FindCertByNickname(const nsAString & aNickname, nsIX509Cert * *_retval); \
  NS_METHOD FindCertByDBKey(const char * aDBkey, nsIX509Cert * *_retval); \
  NS_METHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert * *_retval); \
  NS_METHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert * *_retval); \
  NS_METHOD FindCertByEmailAddress(const char * aEmailAddress, nsIX509Cert * *_retval); \
  NS_METHOD ImportCertificates(uint8_t *data, uint32_t length, uint32_t type, nsIInterfaceRequestor *ctx); \
  NS_METHOD ImportEmailCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx); \
  NS_METHOD ImportUserCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx); \
  NS_METHOD DeleteCertificate(nsIX509Cert *aCert); \
  NS_METHOD SetCertTrust(nsIX509Cert *cert, uint32_t type, uint32_t trust); \
  NS_METHOD SetCertTrustFromString(nsIX509Cert *cert, const nsACString & trustString); \
  NS_METHOD IsCertTrusted(nsIX509Cert *cert, uint32_t certType, uint32_t trustType, bool *_retval); \
  NS_METHOD ImportCertsFromFile(nsIFile *aFile, uint32_t aType); \
  NS_METHOD ImportPKCS12File(nsISupports *aToken, nsIFile *aFile); \
  NS_METHOD ExportPKCS12File(nsISupports *aToken, nsIFile *aFile, uint32_t count, nsIX509Cert **aCerts); \
  NS_METHOD ConstructX509FromBase64(const nsACString & base64, nsIX509Cert * *_retval); \
  NS_METHOD ConstructX509(const char * certDER, uint32_t length, nsIX509Cert * *_retval); \
  NS_METHOD OpenSignedAppFileAsync(AppTrustedRoot trustedRoot, nsIFile *aJarFile, nsIOpenSignedAppFileCallback *callback); \
  NS_METHOD VerifySignedDirectoryAsync(AppTrustedRoot trustedRoot, nsIFile *aUnpackedDir, nsIVerifySignedDirectoryCallback *callback); \
  NS_METHOD VerifySignedManifestAsync(AppTrustedRoot trustedRoot, nsIInputStream *aManifestStream, nsIInputStream *aSignatureStream, nsIVerifySignedManifestCallback *callback); \
  NS_METHOD AddCert(const nsACString & certDER, const nsACString & aTrust, const nsACString & aName); \
  NS_METHOD VerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval); \
  NS_METHOD VerifyCertNow(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval); \
  NS_METHOD AsyncVerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsICertVerificationCallback *aCallback); \
  NS_METHOD ClearOCSPCache(void); \
  NS_METHOD AddCertFromBase64(const nsACString & base64, const nsACString & aTrust, const nsACString & aName); \
  NS_METHOD GetCerts(nsIX509CertList * *_retval); \
  NS_METHOD GetEnterpriseRoots(nsIX509CertList * *_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIX509CERTDB(_to) \
  NS_IMETHOD FindCertByNickname(const nsAString & aNickname, nsIX509Cert * *_retval) override { return _to FindCertByNickname(aNickname, _retval); } \
  NS_IMETHOD FindCertByDBKey(const char * aDBkey, nsIX509Cert * *_retval) override { return _to FindCertByDBKey(aDBkey, _retval); } \
  NS_IMETHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert * *_retval) override { return _to FindEmailEncryptionCert(aNickname, _retval); } \
  NS_IMETHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert * *_retval) override { return _to FindEmailSigningCert(aNickname, _retval); } \
  NS_IMETHOD FindCertByEmailAddress(const char * aEmailAddress, nsIX509Cert * *_retval) override { return _to FindCertByEmailAddress(aEmailAddress, _retval); } \
  NS_IMETHOD ImportCertificates(uint8_t *data, uint32_t length, uint32_t type, nsIInterfaceRequestor *ctx) override { return _to ImportCertificates(data, length, type, ctx); } \
  NS_IMETHOD ImportEmailCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx) override { return _to ImportEmailCertificate(data, length, ctx); } \
  NS_IMETHOD ImportUserCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx) override { return _to ImportUserCertificate(data, length, ctx); } \
  NS_IMETHOD DeleteCertificate(nsIX509Cert *aCert) override { return _to DeleteCertificate(aCert); } \
  NS_IMETHOD SetCertTrust(nsIX509Cert *cert, uint32_t type, uint32_t trust) override { return _to SetCertTrust(cert, type, trust); } \
  NS_IMETHOD SetCertTrustFromString(nsIX509Cert *cert, const nsACString & trustString) override { return _to SetCertTrustFromString(cert, trustString); } \
  NS_IMETHOD IsCertTrusted(nsIX509Cert *cert, uint32_t certType, uint32_t trustType, bool *_retval) override { return _to IsCertTrusted(cert, certType, trustType, _retval); } \
  NS_IMETHOD ImportCertsFromFile(nsIFile *aFile, uint32_t aType) override { return _to ImportCertsFromFile(aFile, aType); } \
  NS_IMETHOD ImportPKCS12File(nsISupports *aToken, nsIFile *aFile) override { return _to ImportPKCS12File(aToken, aFile); } \
  NS_IMETHOD ExportPKCS12File(nsISupports *aToken, nsIFile *aFile, uint32_t count, nsIX509Cert **aCerts) override { return _to ExportPKCS12File(aToken, aFile, count, aCerts); } \
  NS_IMETHOD ConstructX509FromBase64(const nsACString & base64, nsIX509Cert * *_retval) override { return _to ConstructX509FromBase64(base64, _retval); } \
  NS_IMETHOD ConstructX509(const char * certDER, uint32_t length, nsIX509Cert * *_retval) override { return _to ConstructX509(certDER, length, _retval); } \
  NS_IMETHOD OpenSignedAppFileAsync(AppTrustedRoot trustedRoot, nsIFile *aJarFile, nsIOpenSignedAppFileCallback *callback) override { return _to OpenSignedAppFileAsync(trustedRoot, aJarFile, callback); } \
  NS_IMETHOD VerifySignedDirectoryAsync(AppTrustedRoot trustedRoot, nsIFile *aUnpackedDir, nsIVerifySignedDirectoryCallback *callback) override { return _to VerifySignedDirectoryAsync(trustedRoot, aUnpackedDir, callback); } \
  NS_IMETHOD VerifySignedManifestAsync(AppTrustedRoot trustedRoot, nsIInputStream *aManifestStream, nsIInputStream *aSignatureStream, nsIVerifySignedManifestCallback *callback) override { return _to VerifySignedManifestAsync(trustedRoot, aManifestStream, aSignatureStream, callback); } \
  NS_IMETHOD AddCert(const nsACString & certDER, const nsACString & aTrust, const nsACString & aName) override { return _to AddCert(certDER, aTrust, aName); } \
  NS_IMETHOD VerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval) override { return _to VerifyCertAtTime(aCert, aUsage, aFlags, aHostname, aTime, aVerifiedChain, aHasEVPolicy, _retval); } \
  NS_IMETHOD VerifyCertNow(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval) override { return _to VerifyCertNow(aCert, aUsage, aFlags, aHostname, aVerifiedChain, aHasEVPolicy, _retval); } \
  NS_IMETHOD AsyncVerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsICertVerificationCallback *aCallback) override { return _to AsyncVerifyCertAtTime(aCert, aUsage, aFlags, aHostname, aTime, aCallback); } \
  NS_IMETHOD ClearOCSPCache(void) override { return _to ClearOCSPCache(); } \
  NS_IMETHOD AddCertFromBase64(const nsACString & base64, const nsACString & aTrust, const nsACString & aName) override { return _to AddCertFromBase64(base64, aTrust, aName); } \
  NS_IMETHOD GetCerts(nsIX509CertList * *_retval) override { return _to GetCerts(_retval); } \
  NS_IMETHOD GetEnterpriseRoots(nsIX509CertList * *_retval) override { return _to GetEnterpriseRoots(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIX509CERTDB(_to) \
  NS_IMETHOD FindCertByNickname(const nsAString & aNickname, nsIX509Cert * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->FindCertByNickname(aNickname, _retval); } \
  NS_IMETHOD FindCertByDBKey(const char * aDBkey, nsIX509Cert * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->FindCertByDBKey(aDBkey, _retval); } \
  NS_IMETHOD FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->FindEmailEncryptionCert(aNickname, _retval); } \
  NS_IMETHOD FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->FindEmailSigningCert(aNickname, _retval); } \
  NS_IMETHOD FindCertByEmailAddress(const char * aEmailAddress, nsIX509Cert * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->FindCertByEmailAddress(aEmailAddress, _retval); } \
  NS_IMETHOD ImportCertificates(uint8_t *data, uint32_t length, uint32_t type, nsIInterfaceRequestor *ctx) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportCertificates(data, length, type, ctx); } \
  NS_IMETHOD ImportEmailCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportEmailCertificate(data, length, ctx); } \
  NS_IMETHOD ImportUserCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportUserCertificate(data, length, ctx); } \
  NS_IMETHOD DeleteCertificate(nsIX509Cert *aCert) override { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteCertificate(aCert); } \
  NS_IMETHOD SetCertTrust(nsIX509Cert *cert, uint32_t type, uint32_t trust) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCertTrust(cert, type, trust); } \
  NS_IMETHOD SetCertTrustFromString(nsIX509Cert *cert, const nsACString & trustString) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCertTrustFromString(cert, trustString); } \
  NS_IMETHOD IsCertTrusted(nsIX509Cert *cert, uint32_t certType, uint32_t trustType, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsCertTrusted(cert, certType, trustType, _retval); } \
  NS_IMETHOD ImportCertsFromFile(nsIFile *aFile, uint32_t aType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportCertsFromFile(aFile, aType); } \
  NS_IMETHOD ImportPKCS12File(nsISupports *aToken, nsIFile *aFile) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportPKCS12File(aToken, aFile); } \
  NS_IMETHOD ExportPKCS12File(nsISupports *aToken, nsIFile *aFile, uint32_t count, nsIX509Cert **aCerts) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ExportPKCS12File(aToken, aFile, count, aCerts); } \
  NS_IMETHOD ConstructX509FromBase64(const nsACString & base64, nsIX509Cert * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ConstructX509FromBase64(base64, _retval); } \
  NS_IMETHOD ConstructX509(const char * certDER, uint32_t length, nsIX509Cert * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ConstructX509(certDER, length, _retval); } \
  NS_IMETHOD OpenSignedAppFileAsync(AppTrustedRoot trustedRoot, nsIFile *aJarFile, nsIOpenSignedAppFileCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenSignedAppFileAsync(trustedRoot, aJarFile, callback); } \
  NS_IMETHOD VerifySignedDirectoryAsync(AppTrustedRoot trustedRoot, nsIFile *aUnpackedDir, nsIVerifySignedDirectoryCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifySignedDirectoryAsync(trustedRoot, aUnpackedDir, callback); } \
  NS_IMETHOD VerifySignedManifestAsync(AppTrustedRoot trustedRoot, nsIInputStream *aManifestStream, nsIInputStream *aSignatureStream, nsIVerifySignedManifestCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifySignedManifestAsync(trustedRoot, aManifestStream, aSignatureStream, callback); } \
  NS_IMETHOD AddCert(const nsACString & certDER, const nsACString & aTrust, const nsACString & aName) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddCert(certDER, aTrust, aName); } \
  NS_IMETHOD VerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifyCertAtTime(aCert, aUsage, aFlags, aHostname, aTime, aVerifiedChain, aHasEVPolicy, _retval); } \
  NS_IMETHOD VerifyCertNow(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifyCertNow(aCert, aUsage, aFlags, aHostname, aVerifiedChain, aHasEVPolicy, _retval); } \
  NS_IMETHOD AsyncVerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsICertVerificationCallback *aCallback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncVerifyCertAtTime(aCert, aUsage, aFlags, aHostname, aTime, aCallback); } \
  NS_IMETHOD ClearOCSPCache(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ClearOCSPCache(); } \
  NS_IMETHOD AddCertFromBase64(const nsACString & base64, const nsACString & aTrust, const nsACString & aName) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AddCertFromBase64(base64, aTrust, aName); } \
  NS_IMETHOD GetCerts(nsIX509CertList * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCerts(_retval); } \
  NS_IMETHOD GetEnterpriseRoots(nsIX509CertList * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEnterpriseRoots(_retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsX509CertDB : public nsIX509CertDB
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIX509CERTDB

  nsX509CertDB();

private:
  ~nsX509CertDB();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsX509CertDB, nsIX509CertDB)

nsX509CertDB::nsX509CertDB()
{
  /* member initializers and constructor code */
}

nsX509CertDB::~nsX509CertDB()
{
  /* destructor code */
}

/* nsIX509Cert findCertByNickname (in AString aNickname); */
NS_IMETHODIMP nsX509CertDB::FindCertByNickname(const nsAString & aNickname, nsIX509Cert * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIX509Cert findCertByDBKey (in string aDBkey); */
NS_IMETHODIMP nsX509CertDB::FindCertByDBKey(const char * aDBkey, nsIX509Cert * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIX509Cert findEmailEncryptionCert (in AString aNickname); */
NS_IMETHODIMP nsX509CertDB::FindEmailEncryptionCert(const nsAString & aNickname, nsIX509Cert * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIX509Cert findEmailSigningCert (in AString aNickname); */
NS_IMETHODIMP nsX509CertDB::FindEmailSigningCert(const nsAString & aNickname, nsIX509Cert * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIX509Cert findCertByEmailAddress (in string aEmailAddress); */
NS_IMETHODIMP nsX509CertDB::FindCertByEmailAddress(const char * aEmailAddress, nsIX509Cert * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void importCertificates ([array, size_is (length)] in octet data, in unsigned long length, in unsigned long type, in nsIInterfaceRequestor ctx); */
NS_IMETHODIMP nsX509CertDB::ImportCertificates(uint8_t *data, uint32_t length, uint32_t type, nsIInterfaceRequestor *ctx)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void importEmailCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
NS_IMETHODIMP nsX509CertDB::ImportEmailCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void importUserCertificate ([array, size_is (length)] in octet data, in unsigned long length, in nsIInterfaceRequestor ctx); */
NS_IMETHODIMP nsX509CertDB::ImportUserCertificate(uint8_t *data, uint32_t length, nsIInterfaceRequestor *ctx)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void deleteCertificate (in nsIX509Cert aCert); */
NS_IMETHODIMP nsX509CertDB::DeleteCertificate(nsIX509Cert *aCert)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setCertTrust (in nsIX509Cert cert, in unsigned long type, in unsigned long trust); */
NS_IMETHODIMP nsX509CertDB::SetCertTrust(nsIX509Cert *cert, uint32_t type, uint32_t trust)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setCertTrustFromString (in nsIX509Cert cert, in ACString trustString); */
NS_IMETHODIMP nsX509CertDB::SetCertTrustFromString(nsIX509Cert *cert, const nsACString & trustString)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean isCertTrusted (in nsIX509Cert cert, in unsigned long certType, in unsigned long trustType); */
NS_IMETHODIMP nsX509CertDB::IsCertTrusted(nsIX509Cert *cert, uint32_t certType, uint32_t trustType, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void importCertsFromFile (in nsIFile aFile, in unsigned long aType); */
NS_IMETHODIMP nsX509CertDB::ImportCertsFromFile(nsIFile *aFile, uint32_t aType)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void importPKCS12File (in nsISupports aToken, in nsIFile aFile); */
NS_IMETHODIMP nsX509CertDB::ImportPKCS12File(nsISupports *aToken, nsIFile *aFile)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void exportPKCS12File (in nsISupports aToken, in nsIFile aFile, in unsigned long count, [array, size_is (count)] in nsIX509Cert aCerts); */
NS_IMETHODIMP nsX509CertDB::ExportPKCS12File(nsISupports *aToken, nsIFile *aFile, uint32_t count, nsIX509Cert **aCerts)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIX509Cert constructX509FromBase64 (in ACString base64); */
NS_IMETHODIMP nsX509CertDB::ConstructX509FromBase64(const nsACString & base64, nsIX509Cert * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIX509Cert constructX509 (in string certDER, in unsigned long length); */
NS_IMETHODIMP nsX509CertDB::ConstructX509(const char * certDER, uint32_t length, nsIX509Cert * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void openSignedAppFileAsync (in AppTrustedRoot trustedRoot, in nsIFile aJarFile, in nsIOpenSignedAppFileCallback callback); */
NS_IMETHODIMP nsX509CertDB::OpenSignedAppFileAsync(AppTrustedRoot trustedRoot, nsIFile *aJarFile, nsIOpenSignedAppFileCallback *callback)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void verifySignedDirectoryAsync (in AppTrustedRoot trustedRoot, in nsIFile aUnpackedDir, in nsIVerifySignedDirectoryCallback callback); */
NS_IMETHODIMP nsX509CertDB::VerifySignedDirectoryAsync(AppTrustedRoot trustedRoot, nsIFile *aUnpackedDir, nsIVerifySignedDirectoryCallback *callback)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void verifySignedManifestAsync (in AppTrustedRoot trustedRoot, in nsIInputStream aManifestStream, in nsIInputStream aSignatureStream, in nsIVerifySignedManifestCallback callback); */
NS_IMETHODIMP nsX509CertDB::VerifySignedManifestAsync(AppTrustedRoot trustedRoot, nsIInputStream *aManifestStream, nsIInputStream *aSignatureStream, nsIVerifySignedManifestCallback *callback)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addCert (in ACString certDER, in ACString aTrust, in AUTF8String aName); */
NS_IMETHODIMP nsX509CertDB::AddCert(const nsACString & certDER, const nsACString & aTrust, const nsACString & aName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* int32_t verifyCertAtTime (in nsIX509Cert aCert, in int64_t aUsage, in uint32_t aFlags, in string aHostname, in uint64_t aTime, out nsIX509CertList aVerifiedChain, out bool aHasEVPolicy); */
NS_IMETHODIMP nsX509CertDB::VerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* int32_t verifyCertNow (in nsIX509Cert aCert, in int64_t aUsage, in uint32_t aFlags, in string aHostname, out nsIX509CertList aVerifiedChain, out bool aHasEVPolicy); */
NS_IMETHODIMP nsX509CertDB::VerifyCertNow(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, nsIX509CertList * *aVerifiedChain, bool *aHasEVPolicy, int32_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void asyncVerifyCertAtTime (in nsIX509Cert aCert, in int64_t aUsage, in uint32_t aFlags, in string aHostname, in uint64_t aTime, in nsICertVerificationCallback aCallback); */
NS_IMETHODIMP nsX509CertDB::AsyncVerifyCertAtTime(nsIX509Cert *aCert, int64_t aUsage, uint32_t aFlags, const char * aHostname, uint64_t aTime, nsICertVerificationCallback *aCallback)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void clearOCSPCache (); */
NS_IMETHODIMP nsX509CertDB::ClearOCSPCache()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addCertFromBase64 (in ACString base64, in ACString aTrust, in AUTF8String aName); */
NS_IMETHODIMP nsX509CertDB::AddCertFromBase64(const nsACString & base64, const nsACString & aTrust, const nsACString & aName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIX509CertList getCerts (); */
NS_IMETHODIMP nsX509CertDB::GetCerts(nsIX509CertList * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIX509CertList getEnterpriseRoots (); */
NS_IMETHODIMP nsX509CertDB::GetEnterpriseRoots(nsIX509CertList * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_nsIX509CertDB_h__ */