Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-08 10:33:32

0001 #ifndef __CRYPTO_X509REQ_H__
0002 #define __CRYPTO_X509REQ_H__
0003 /******************************************************************************/
0004 /*                                                                            */
0005 /*                     X r d C r y p t o X 5 0 9 R e q. h h                   */
0006 /*                                                                            */
0007 /* (c) 2005 G. Ganis , CERN                                                   */
0008 /*                                                                            */
0009 /* This file is part of the XRootD software suite.                            */
0010 /*                                                                            */
0011 /* XRootD is free software: you can redistribute it and/or modify it under    */
0012 /* the terms of the GNU Lesser General Public License as published by the     */
0013 /* Free Software Foundation, either version 3 of the License, or (at your     */
0014 /* option) any later version.                                                 */
0015 /*                                                                            */
0016 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
0017 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
0018 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
0019 /* License for more details.                                                  */
0020 /*                                                                            */
0021 /* You should have received a copy of the GNU Lesser General Public License   */
0022 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
0023 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
0024 /*                                                                            */
0025 /* The copyright holder's institutional names and contributor's names may not */
0026 /* be used to endorse or promote products derived from this software without  */
0027 /* specific prior written permission of the institution or contributor.       */
0028 /*                                                                            */
0029 /******************************************************************************/
0030 
0031 /* ************************************************************************** */
0032 /*                                                                            */
0033 /* Abstract interface for X509 certificates.                                  */
0034 /* Allows to plug-in modules based on different crypto implementation         */
0035 /* (OpenSSL, Botan, ...)                                                      */
0036 /*                                                                            */
0037 /* ************************************************************************** */
0038 
0039 #include "XrdSut/XrdSutBucket.hh"
0040 #include "XrdCrypto/XrdCryptoRSA.hh"
0041 
0042 typedef void * XrdCryptoX509Reqdata;
0043 
0044 // ---------------------------------------------------------------------------//
0045 //
0046 // X509 request interface
0047 // Describes a one certificate request
0048 //
0049 // ---------------------------------------------------------------------------//
0050 class XrdCryptoX509Req {
0051 public:
0052 
0053    XrdCryptoX509Req(int v = -1) { SetVersion(v); }
0054    virtual ~XrdCryptoX509Req() { }
0055 
0056    // Status
0057    virtual bool IsValid();
0058 
0059    // Access underlying data (in opaque form: used in chains)
0060    virtual XrdCryptoX509Reqdata Opaque();
0061 
0062    // Access certificate key
0063    virtual XrdCryptoRSA *PKI();
0064 
0065    // Export in form of bucket (for transfers)
0066    virtual XrdSutBucket *Export();
0067 
0068    // Dump information
0069    virtual void Dump();
0070 
0071    // Subject of bottom certificate
0072    virtual const char *Subject();
0073    virtual const char *SubjectHash(int);   // hash 
0074    const char *SubjectHash() { return SubjectHash(0); }   // hash 
0075 
0076    // Retrieve a given extension if there (in opaque form) 
0077    virtual XrdCryptoX509Reqdata GetExtension(const char *oid);
0078 
0079    // Verify signature
0080    virtual bool Verify();
0081 
0082    // Set / Get version
0083    int Version() const { return version; }
0084    void SetVersion(int v) { version = v; }
0085 
0086 private:
0087    int version;   // Version of the plugin producing the request
0088 };
0089 
0090 #endif