xrootd
XrdCryptoX509Req.hh
Go to the documentation of this file.
1 // $Id$
2 #ifndef __CRYPTO_X509REQ_H__
3 #define __CRYPTO_X509REQ_H__
4 /******************************************************************************/
5 /* */
6 /* X r d C r y p t o X 5 0 9 R e q. h h */
7 /* */
8 /* */
9 /* (c) 2005 G. Ganis , CERN */
10 /* */
11 /******************************************************************************/
12 
13 /* ************************************************************************** */
14 /* */
15 /* Abstract interface for X509 certificates. */
16 /* Allows to plug-in modules based on different crypto implementation */
17 /* (OpenSSL, Botan, ...) */
18 /* */
19 /* ************************************************************************** */
20 
21 #include <XrdSut/XrdSutBucket.hh>
23 
24 typedef void * XrdCryptoX509Reqdata;
25 
26 // ---------------------------------------------------------------------------//
27 //
28 // X509 request interface
29 // Describes a one certificate request
30 //
31 // ---------------------------------------------------------------------------//
33 public:
34 
35  XrdCryptoX509Req(int v = -1) { SetVersion(v); }
36  virtual ~XrdCryptoX509Req() { }
37 
38  // Status
39  virtual bool IsValid();
40 
41  // Access underlying data (in opaque form: used in chains)
42  virtual XrdCryptoX509Reqdata Opaque();
43 
44  // Access certificate key
45  virtual XrdCryptoRSA *PKI();
46 
47  // Export in form of bucket (for transfers)
48  virtual XrdSutBucket *Export();
49 
50  // Dump information
51  virtual void Dump();
52 
53  // Subject of bottom certificate
54  virtual const char *Subject();
55  virtual const char *SubjectHash(); // hash
56 
57  // Retrieve a given extension if there (in opaque form)
58  virtual XrdCryptoX509Reqdata GetExtension(const char *oid);
59 
60  // Verify signature
61  virtual bool Verify();
62 
63  // Set / Get version
64  int Version() const { return version; }
65  void SetVersion(int v) { version = v; }
66 
67 private:
68  int version; // Version of the plugin producing the request
69 };
70 
71 #endif