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 * OpenSSLCryptoProvider := Base class to define an OpenSSL module 00021 * 00022 * Author(s): Berin Lautenbach 00023 * 00024 * $Id: OpenSSLCryptoProvider.hpp,v 1.15 2005/06/04 11:30:26 blautenb Exp $ 00025 * 00026 */ 00027 00028 #ifndef OPENSSLCRYPTOPROVIDER_INCLUDE 00029 #define OPENSSLCRYPTOPROVIDER_INCLUDE 00030 00031 #include <xsec/framework/XSECDefs.hpp> 00032 #include <xsec/enc/XSECCryptoProvider.hpp> 00033 00034 #if defined (HAVE_OPENSSL) 00035 00048 /*\@{*/ 00049 00050 class DSIG_EXPORT OpenSSLCryptoProvider : public XSECCryptoProvider { 00051 00052 00053 public : 00054 00057 00058 OpenSSLCryptoProvider(); 00059 virtual ~OpenSSLCryptoProvider(); 00060 00062 00065 00076 virtual XSECCryptoHash * hashSHA1(); 00077 00089 virtual XSECCryptoHash * hashSHA(int length = 160); 00090 00102 virtual XSECCryptoHash * hashHMACSHA1(); 00103 00116 virtual XSECCryptoHash * hashHMACSHA(int length = 160); 00117 00128 virtual XSECCryptoHash * hashMD5(); 00129 00146 virtual XSECCryptoHash * hashHMACMD5(); 00147 00158 virtual XSECCryptoKeyHMAC * keyHMAC(void); 00159 00161 00164 00175 virtual XSECCryptoBase64 * base64(); 00176 00178 00181 00191 virtual XSECCryptoKeyDSA * keyDSA(); 00192 00202 virtual XSECCryptoKeyRSA * keyRSA(); 00203 00214 virtual XSECCryptoX509 * X509(); 00215 00223 virtual bool algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg); 00224 00232 virtual bool algorithmSupported(XSECCryptoHash::HashType alg); 00233 00244 virtual XSECCryptoSymmetricKey * keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType alg); 00245 00258 virtual unsigned int getRandom(unsigned char * buffer, unsigned int numOctets); 00259 00260 00262 00265 00270 virtual const XMLCh * getProviderName(); 00271 00273 00274 /*\@}*/ 00275 00276 }; 00277 00278 #endif /* HAVE_OPENSSL */ 00279 #endif /* OPENSSLCRYPTOPROVIDER_INCLUDE */