ARC SDK
NSSUtil.h
1 #ifndef __ARC_NSSUTIL_H__
2 #define __ARC_NSSUTIL_H__
3 
4 #include <string>
5 
6 #include <arc/DateTime.h>
7 
9 namespace AuthN {
10 
12  struct certInfo {
13  std::string certname;
14  std::string subject_dn;
15  std::string issuer_dn;
16  unsigned long serial;
17  Arc::Time start;
18  Arc::Time end;
19  };
20 
25  bool nssInit(const std::string& configdir);
26 
27  bool nssExportCertificate(const std::string& certname, const std::string& certfile);
28 
29  bool nssOutputPKCS12(const std::string certname, char* outfile, char* slotpw, char* p12pw);
30 
31  bool nssGenerateCSR(const std::string& privkey_name, const std::string& dn, const char* slotpw, const std::string& outfile, std::string& privk_str, bool ascii = true);
32 
33  void nssListUserCertificatesInfo(std::list<certInfo>& certInfolist);
34 
35  bool nssCreateCert(const std::string& csrfile, const std::string& issuername, const char* passwd, const int duration, const std::string& vomsacseq, std::string& outfile, bool ascii = true);
36 
37  bool nssImportCertAndPrivateKey(char* slotpw, const std::string& keyfile, const std::string& keyname, const std::string& certfile, const std::string& certname, const char* trusts = NULL, bool ascii = true);
38 
39  bool nssImportCert(char* slotpw, const std::string& certfile, const std::string& name, const char* trusts = NULL, bool ascii = true);
40 }
41 
42 #endif /*__ARC_NSSUTIL_H__*/