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 450743 2006-09-28 07:51:31Z blautenb $
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 
00142     virtual bool verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, 
00143                                  unsigned int hashLen,
00144                                  const char * base64Signature,
00145                                  unsigned int sigLen,
00146                                  hashMethod hm) = 0;
00147 
00169     virtual unsigned int signSHA1PKCS1Base64Signature(unsigned char * hashBuf,
00170         unsigned int hashLen,
00171         char * base64SignatureBuf,
00172         unsigned int base64SignatureBufLen,
00173         hashMethod hm) = 0;
00174 
00190     virtual unsigned int privateDecrypt(const unsigned char * inBuf,
00191                                  unsigned char * plainBuf, 
00192                                  unsigned int inLength,
00193                                  unsigned int maxOutLength,
00194                                  PaddingType padding,
00195                                  hashMethod hm) = 0;
00196 
00213     virtual unsigned int publicEncrypt(const unsigned char * inBuf,
00214                                  unsigned char * cipherBuf, 
00215                                  unsigned int inLength,
00216                                  unsigned int maxOutLength,
00217                                  PaddingType padding,
00218                                  hashMethod hm) = 0;
00219 
00226     virtual unsigned int getLength(void) = 0;
00227 
00229 
00241 
00251     virtual void loadPublicModulusBase64BigNums(const char * b64, unsigned int len) = 0;
00252 
00262     virtual void loadPublicExponentBase64BigNums(const char * b64, unsigned int len) = 0;
00263 
00265 
00266 };
00267 
00268 
00269 
00270 #endif /* XSECCRYPTOKEYRSA_INCLUDE */

Generated on Sun Jan 28 19:37:24 2007 for XML-Security-C by  doxygen 1.4.2