Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

XSECCryptoProvider.hpp

Go to the documentation of this file.
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  * XSECCryptoProvider := Base virtual class to define a crpyto module
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: XSECCryptoProvider.hpp,v 1.18 2005/06/04 11:30:26 blautenb Exp $
00025  *
00026  */
00027 
00028 #ifndef XSECCRYPTOPROVIDER_INCLUDE
00029 #define XSECCRYPTOPROVIDER_INCLUDE
00030 
00031 #include <xsec/framework/XSECDefs.hpp>
00032 #include <xsec/enc/XSECCryptoHash.hpp>
00033 #include <xsec/enc/XSECCryptoKeyHMAC.hpp>
00034 #include <xsec/enc/XSECCryptoBase64.hpp>
00035 #include <xsec/enc/XSECCryptoX509.hpp>
00036 #include <xsec/enc/XSECCryptoKeyDSA.hpp>
00037 #include <xsec/enc/XSECCryptoKeyRSA.hpp>
00038 #include <xsec/enc/XSECCryptoSymmetricKey.hpp>
00039 
00105 // Some constants
00106 
00117 #define CRYPTO_MAX_HASH_SIZE        128
00118 
00123 #define CRYPTO_OID_DSA              "1.2.840.10040.4.1"
00124 
00136 class DSIG_EXPORT XSECCryptoProvider {
00137 
00138 
00139 public :
00140 
00143     
00144     XSECCryptoProvider() {};
00145     virtual ~XSECCryptoProvider() {};
00147 
00148 
00151 
00163     virtual XSECCryptoHash          * hashSHA1() = 0;
00164 
00176     virtual XSECCryptoHash          * hashSHA(int length = 160) = 0;
00177 
00190     virtual XSECCryptoHash          * hashHMACSHA1() = 0;
00191 
00204     virtual XSECCryptoHash          * hashHMACSHA(int length = 160) = 0;
00205 
00216     virtual XSECCryptoHash          * hashMD5() = 0;
00217 
00234     virtual XSECCryptoHash          * hashHMACMD5() = 0;
00235 
00246     virtual XSECCryptoKeyHMAC       * keyHMAC(void) = 0;
00247 
00249 
00252 
00262     virtual XSECCryptoBase64        * base64() = 0;
00263 
00265 
00268 
00278     virtual XSECCryptoKeyDSA        * keyDSA() = 0;
00279 
00289     virtual XSECCryptoKeyRSA        * keyRSA() = 0;
00290 
00301     virtual XSECCryptoX509          * X509() = 0;
00302 
00310     virtual bool algorithmSupported(XSECCryptoSymmetricKey::SymmetricKeyType alg) = 0;
00311 
00319     virtual bool algorithmSupported(XSECCryptoHash::HashType alg) = 0;
00320     
00331     virtual XSECCryptoSymmetricKey  * keySymmetric(XSECCryptoSymmetricKey::SymmetricKeyType alg) = 0;
00332 
00345     virtual unsigned int getRandom(unsigned char * buffer, unsigned int numOctets) = 0;
00346 
00348 
00351 
00356     virtual const XMLCh * getProviderName() = 0;
00357 
00359 
00360     /*\@}*/
00361 };
00362 
00363 
00364 #endif /* XSECCRYPTOPROVIDER_INCLUDE */

Generated on Sun Jul 3 17:37:28 2005 for XML-Security-C by  doxygen 1.4.2