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

XSECCryptoKeyRSA.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  * XSECCryptoKeyRSA := RSA Keys
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: XSECCryptoKeyRSA.hpp,v 1.10 2005/06/04 11:30:26 blautenb Exp $
00025  *
00026  */
00027 
00028 #ifndef XSECCRYPTOKEYRSA_INCLUDE
00029 #define XSECCRYPTOKEYRSA_INCLUDE
00030 
00031 #include <xsec/enc/XSECCryptoKey.hpp>
00032 
00044 class DSIG_EXPORT XSECCryptoKeyRSA : public XSECCryptoKey {
00045 
00046 public :
00047 
00054     enum PaddingType {
00055 
00056         PAD_NONE        = 0,        
00057         PAD_PKCS_1_5    = 1,        
00058         PAD_OAEP_MGFP1  = 2         
00060     };
00061 
00064 
00065     XSECCryptoKeyRSA() {};
00066     virtual ~XSECCryptoKeyRSA() {};
00067 
00069 
00072 
00080     virtual XSECCryptoKey::KeyType getKeyType() {return KEY_NONE;}
00081     
00086     virtual XSECCryptoKey * clone() = 0;
00087 
00089 
00095 
00109     virtual void setOAEPparams(unsigned char * params, unsigned int paramsLen) = 0;
00110 
00117     virtual unsigned int getOAEPparamsLen(void) = 0;
00118 
00126     virtual const unsigned char * getOAEPparams(void) = 0;
00127 
00141     virtual bool verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, 
00142                                  unsigned int hashLen,
00143                                  const char * base64Signature,
00144                                  unsigned int sigLen) = 0;
00145 
00165     virtual unsigned int signSHA1PKCS1Base64Signature(unsigned char * hashBuf,
00166         unsigned int hashLen,
00167         char * base64SignatureBuf,
00168         unsigned int base64SignatureBufLen) = 0;
00169 
00185     virtual unsigned int privateDecrypt(const unsigned char * inBuf,
00186                                  unsigned char * plainBuf, 
00187                                  unsigned int inLength,
00188                                  unsigned int maxOutLength,
00189                                  PaddingType padding,
00190                                  hashMethod hm) = 0;
00191 
00208     virtual unsigned int publicEncrypt(const unsigned char * inBuf,
00209                                  unsigned char * cipherBuf, 
00210                                  unsigned int inLength,
00211                                  unsigned int maxOutLength,
00212                                  PaddingType padding,
00213                                  hashMethod hm) = 0;
00214 
00221     virtual unsigned int getLength(void) = 0;
00222 
00224 
00236 
00246     virtual void loadPublicModulusBase64BigNums(const char * b64, unsigned int len) = 0;
00247 
00257     virtual void loadPublicExponentBase64BigNums(const char * b64, unsigned int len) = 0;
00258 
00260 
00261 };
00262 
00263 
00264 
00265 #endif /* XSECCRYPTOKEYRSA_INCLUDE */

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