00001 /* 00002 * Copyright 2002-2005 The Apache Software Foundation. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 /* 00018 * XSEC 00019 * 00020 * TXFMMD5 := Class that performs a MD5 transform 00021 * 00022 * Author(s): Berin Lautenbach 00023 * 00024 * $Id: TXFMMD5.hpp,v 1.6 2005/02/03 13:50:12 milan Exp $ 00025 * 00026 */ 00027 00028 #ifndef TXFMMD5_INCLUDE 00029 #define TXFMMD5_INCLUDE 00030 00031 // XSEC Includes 00032 00033 #include <xsec/transformers/TXFMBase.hpp> 00034 #include <xsec/enc/XSECCryptoProvider.hpp> 00035 00041 class DSIG_EXPORT TXFMMD5 : public TXFMBase { 00042 00043 private: 00044 00045 XSECCryptoHash * mp_h; // To hold the hash 00046 unsigned char md_value[CRYPTO_MAX_HASH_SIZE]; // Final output 00047 unsigned int md_len; // Length of digest 00048 00049 unsigned int toOutput; // Amount still to output 00050 00051 public: 00052 00053 TXFMMD5(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *doc, XSECCryptoKey * key = NULL); 00054 ~TXFMMD5(); 00055 00056 // Methods to get tranform output type and input requirement 00057 00058 virtual TXFMBase::ioType getInputType(void); 00059 virtual TXFMBase::ioType getOutputType(void); 00060 virtual nodeType getNodeType(void); 00061 00062 // Methods to set input data 00063 00064 virtual void setInput(TXFMBase * inputT); 00065 00066 // Methods to get output data 00067 00068 virtual unsigned int readBytes(XMLByte * const toFill, const unsigned int maxToFill); 00069 virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *getDocument(); 00070 virtual XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *getFragmentNode(); 00071 virtual const XMLCh * getFragmentId(); 00072 00073 private: 00074 TXFMMD5(); 00075 }; 00076 00077 00078 00079 #endif /* TXFMMD5 */