XRootD
Loading...
Searching...
No Matches
XrdCryptoX509Crl.cc
Go to the documentation of this file.
1/******************************************************************************/
2/* */
3/* X r d C r y p t o X 5 0 9 C r l. c c */
4/* */
5/* (c) 2005 G. Ganis , CERN */
6/* */
7/* This file is part of the XRootD software suite. */
8/* */
9/* XRootD is free software: you can redistribute it and/or modify it under */
10/* the terms of the GNU Lesser General Public License as published by the */
11/* Free Software Foundation, either version 3 of the License, or (at your */
12/* option) any later version. */
13/* */
14/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
15/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
16/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
17/* License for more details. */
18/* */
19/* You should have received a copy of the GNU Lesser General Public License */
20/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
21/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
22/* */
23/* The copyright holder's institutional names and contributor's names may not */
24/* be used to endorse or promote products derived from this software without */
25/* specific prior written permission of the institution or contributor. */
26/* */
27/******************************************************************************/
28
29/* ************************************************************************** */
30/* */
31/* Abstract interface for X509 CRLs. */
32/* Allows to plug-in modules based on different crypto implementation */
33/* (OpenSSL, Botan, ...) */
34/* */
35/* ************************************************************************** */
36#include <ctime>
38
39//_____________________________________________________________________________
41{
42 // Dump content
43 ABSTRACTMETHOD("XrdCryptoX509Crl::Dump");
44}
45
46//_____________________________________________________________________________
48{
49 // Check validity
50 ABSTRACTMETHOD("XrdCryptoX509Crl::IsValid");
51 return 0;
52}
53
54//_____________________________________________________________________________
56{
57 // Check expiration at UTC time 'when'. Use when =0 (default) to check
58 // at present time.
59
60 int now = (when > 0) ? when : (int)time(0);
61 return (now > NextUpdate());
62}
63
64//_____________________________________________________________________________
66{
67 // Time of last update
68 ABSTRACTMETHOD("XrdCryptoX509Crl::LastUpdate");
69 return -1;
70}
71
72//_____________________________________________________________________________
74{
75 // Time of next update
76 ABSTRACTMETHOD("XrdCryptoX509Crl::NextUpdate");
77 return -1;
78}
79
80//_____________________________________________________________________________
82{
83 // Return parent file name
84 ABSTRACTMETHOD("XrdCryptoX509Crl::ParentFile");
85 return (const char *)0;
86}
87
88//_____________________________________________________________________________
90{
91 // Return issuer name
92 ABSTRACTMETHOD("XrdCryptoX509Crl::Issuer");
93 return (const char *)0;
94}
95
96//_____________________________________________________________________________
98{
99 // Return issuer name
100 ABSTRACTMETHOD("XrdCryptoX509Crl::IssuerHash");
101 return (const char *)0;
102}
103
104//_____________________________________________________________________________
106{
107 // Return underlying certificate in raw format
108 ABSTRACTMETHOD("XrdCryptoX509Crl::Opaque");
109 return (XrdCryptoX509Crldata)0;
110}
111
112//_____________________________________________________________________________
114{
115 // Verify certificate signature with pub key of ref cert
116 ABSTRACTMETHOD("XrdCryptoX509Crl::Verify");
117 return 0;
118}
119
120//_____________________________________________________________________________
122{
123 // Verify if certificate with specified serial number has been revoked
124 ABSTRACTMETHOD("XrdCryptoX509Crl::IsRevoked");
125 return 1;
126}
127
128//_____________________________________________________________________________
129bool XrdCryptoX509Crl::IsRevoked(const char *, int)
130{
131 // Verify if certificate with specified serial number has been revoked
132 ABSTRACTMETHOD("XrdCryptoX509Crl::IsRevoked");
133 return 1;
134}
#define ABSTRACTMETHOD(x)
void * XrdCryptoX509Crldata
virtual time_t NextUpdate()
virtual void Dump()
virtual bool IsValid()
virtual bool IsExpired(int when=0)
const char * IssuerHash()
virtual bool IsRevoked(int serialnumber, int when)
virtual time_t LastUpdate()
virtual const char * Issuer()
virtual const char * ParentFile()
virtual XrdCryptoX509Crldata Opaque()
virtual bool Verify(XrdCryptoX509 *ref)