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

OpenSSLCryptoKeyDSA.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 2002-2004 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  * imitations under the License.
00015  */
00016 
00017 /*
00018  * XSEC
00019  *
00020  * OpenSSLCryptoKeyDSA := DSA Keys
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: OpenSSLCryptoKeyDSA.hpp,v 1.7 2004/02/08 10:22:50 blautenb Exp $
00025  *
00026  */
00027 
00028 #ifndef OPENSSLCRYPTOKEYDSA_INCLUDE
00029 #define OPENSSLCRYPTOKEYDSA_INCLUDE
00030 
00031 #include <xsec/enc/XSECCryptoKeyDSA.hpp>
00032 
00033 #if defined (HAVE_OPENSSL)
00034 #include <openssl/evp.h>
00035 
00048 class DSIG_EXPORT OpenSSLCryptoKeyDSA : public XSECCryptoKeyDSA {
00049 
00050 public :
00051 
00054     
00055     OpenSSLCryptoKeyDSA();
00056 
00064     virtual ~OpenSSLCryptoKeyDSA();
00065 
00067 
00070 
00078     virtual XSECCryptoKey::KeyType getKeyType();
00079 
00084     virtual const XMLCh * getProviderName() {return DSIGConstants::s_unicodeStrPROVOpenSSL;}
00085 
00090     virtual XSECCryptoKey * clone();
00091 
00093 
00096 
00111     virtual unsigned int signBase64Signature(unsigned char * hashBuf,
00112         unsigned int hashLen,
00113         char * base64SignatureBuf,
00114         unsigned int base64SignatureBufLen);
00115 
00129     virtual bool verifyBase64Signature(unsigned char * hashBuf, 
00130                              unsigned int hashLen,
00131                              char * base64Signature,
00132                              unsigned int sigLen);
00133     
00135 
00143 
00151     virtual void loadPBase64BigNums(const char * b64, unsigned int len);
00152 
00160     virtual void loadQBase64BigNums(const char * b64, unsigned int len);
00161     
00169     virtual void loadGBase64BigNums(const char * b64, unsigned int len);
00170 
00178     virtual void loadYBase64BigNums(const char * b64, unsigned int len);
00179 
00187     virtual void loadJBase64BigNums(const char * b64, unsigned int len);
00188 
00190 
00193 
00201     OpenSSLCryptoKeyDSA(EVP_PKEY *k);
00202 
00204 
00205 
00206 private:
00207 
00208     XSECCryptoKey::KeyType          m_keyType;
00209     DSA                             * mp_dsaKey;
00210     
00211 };
00212 
00213 #endif /* HAVE_OPENSSL */
00214 #endif /* XSECCRYPTOKEYDSA_INCLUDE */

Generated on Sun Mar 14 20:20:35 2004 for XML-Security-C by doxygen 1.3.2