xrootd
XrdCryptosslMsgDigest.hh
Go to the documentation of this file.
00001 #ifndef __CRYPTO_MSGDGSTSSL_H__
00002 #define __CRYPTO_MSGDGSTSSL_H__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*             X r d C r y p t o S s l M s g D i g e s t . h h                */
00006 /*                                                                            */
00007 /* (c) 2004 by the Board of Trustees of the Leland Stanford, Jr., University  */
00008 /*   Produced by Gerri Ganis for CERN                                         */
00009 /*                                                                            */
00010 /* This file is part of the XRootD software suite.                            */
00011 /*                                                                            */
00012 /* XRootD is free software: you can redistribute it and/or modify it under    */
00013 /* the terms of the GNU Lesser General Public License as published by the     */
00014 /* Free Software Foundation, either version 3 of the License, or (at your     */
00015 /* option) any later version.                                                 */
00016 /*                                                                            */
00017 /* XRootD is distributed in the hope that it will be useful, but WITHOUT      */
00018 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or      */
00019 /* FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public       */
00020 /* License for more details.                                                  */
00021 /*                                                                            */
00022 /* You should have received a copy of the GNU Lesser General Public License   */
00023 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file  */
00024 /* COPYING (GPL license).  If not, see <http://www.gnu.org/licenses/>.        */
00025 /*                                                                            */
00026 /* The copyright holder's institutional names and contributor's names may not */
00027 /* be used to endorse or promote products derived from this software without  */
00028 /* specific prior written permission of the institution or contributor.       */
00029 /******************************************************************************/
00030 
00031 /* ************************************************************************** */
00032 /*                                                                            */
00033 /* OpenSSL implementation of XrdSecCMsgDigest                                 */
00034 /*                                                                            */
00035 /* ************************************************************************** */
00036 
00037 #include <openssl/evp.h>
00038 
00039 #include "XrdCrypto/XrdCryptoMsgDigest.hh"
00040 
00041 // ---------------------------------------------------------------------------//
00042 //
00043 // Message Digest implementation buffer
00044 //
00045 // ---------------------------------------------------------------------------//
00046 class XrdCryptosslMsgDigest : public XrdCryptoMsgDigest
00047 {
00048 private:
00049    bool valid;
00050    EVP_MD_CTX mdctx;
00051 
00052    int Init(const char *dgst);
00053 
00054 public:
00055    XrdCryptosslMsgDigest(const char *dgst);
00056    virtual ~XrdCryptosslMsgDigest();
00057 
00058    // Validity
00059    bool IsValid() { return valid; }
00060 
00061    // Support
00062    static bool IsSupported(const char *dgst);
00063 
00064    int Reset(const char *dgst = 0);
00065    int Update(const char *b, int l);
00066    int Final();
00067 };
00068 
00069 #endif