xrootd
XrdCryptosslgsiAux.hh
Go to the documentation of this file.
1 #ifndef __CRYPTO_SSLGSIAUX_H__
2 #define __CRYPTO_SSLGSIAUX_H__
3 /******************************************************************************/
4 /* */
5 /* X r d C r y p t o s s l g s i A u x . h h */
6 /* */
7 /* (c) 2005, G. Ganis / CERN */
8 /* */
9 /* This file is part of the XRootD software suite. */
10 /* */
11 /* XRootD is free software: you can redistribute it and/or modify it under */
12 /* the terms of the GNU Lesser General Public License as published by the */
13 /* Free Software Foundation, either version 3 of the License, or (at your */
14 /* option) any later version. */
15 /* */
16 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
17 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
18 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
19 /* License for more details. */
20 /* */
21 /* You should have received a copy of the GNU Lesser General Public License */
22 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
23 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
24 /* */
25 /* The copyright holder's institutional names and contributor's names may not */
26 /* be used to endorse or promote products derived from this software without */
27 /* specific prior written permission of the institution or contributor. */
28 /* */
29 /******************************************************************************/
30 
31 /* ************************************************************************** */
32 /* */
33 /* GSI utility functions */
34 /* */
35 /* ************************************************************************** */
39 #include "XrdOuc/XrdOucString.hh"
40 
41 // The OID of the extension
42 #define gsiProxyCertInfo_OID "1.3.6.1.4.1.3536.1.222"
43 
44 //
45 // Function to check presence of a proxyCertInfo and retrieve the path length
46 // constraint. Written following RFC3820 and examples in openssl-<vers>/crypto
47 // source code. Extracts the policy field but ignores it contents.
48 bool XrdSslgsiProxyCertInfo(const void *ext, int &pathlen, bool *haspolicy = 0);
49 void XrdSslgsiSetPathLenConstraint(void *ext, int pathlen);
50 
51 //
52 // Proxies
53 //
54 typedef struct {
55  int bits; // Number of bits in the RSA key [512]
56  int valid; // Duration validity in secs [43200 (12 hours)]
57  int depthlen; // Maximum depth of the path of proxy certificates
58  // that can signed by this proxy certificates
59  // [-1 (== unlimited)]
61 //
62 // Create proxy certificates
63 int XrdSslgsiX509CreateProxy(const char *, const char *, XrdProxyOpt_t *,
64  XrdCryptosslgsiX509Chain *, XrdCryptoRSA **, const char *);
65 //
66 // Create a proxy certificate request
69 //
70 // Sign a proxy certificate request
73 //
74 // Dump extensions
76 //
77 // Get VOMS attributes, if any
79 
80 /******************************************************************************/
81 /* E r r o r s i n P r o x y M a n i p u l a t i o n s */
82 /******************************************************************************/
83 #define kErrPX_Error 1 // Generic error condition
84 #define kErrPX_BadEECfile 2 // Absent or bad EEC cert or key file
85 #define kErrPX_BadEECkey 3 // Inconsistent EEC key
86 #define kErrPX_ExpiredEEC 4 // EEC is expired
87 #define kErrPX_NoResources 5 // Unable to create new objects
88 #define kErrPX_SetAttribute 6 // Unable to set a certificate attribute
89 #define kErrPX_SetPathDepth 7 // Unable to set path depth
90 #define kErrPX_Signing 8 // Problems signing
91 #define kErrPX_GenerateKey 9 // Problem generating the RSA key
92 #define kErrPX_ProxyFile 10 // Problem creating / updating proxy file
93 #define kErrPX_BadNames 11 // Names in certificates are bad
94 #define kErrPX_BadSerial 12 // Problems resolving serial number
95 #define kErrPX_BadExtension 13 // Problems with the extensions
96 
97 #endif
98