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

XSECCryptoKeyRSA.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  * XSECCryptoKeyRSA := RSA Keys
00021  *
00022  * Author(s): Berin Lautenbach
00023  *
00024  * $Id: XSECCryptoKeyRSA.hpp,v 1.8 2004/02/08 10:23:57 blautenb Exp $
00025  *
00026  */
00027 
00028 #ifndef XSECCRYPTOKEYRSA_INCLUDE
00029 #define XSECCRYPTOKEYRSA_INCLUDE
00030 
00031 #include <xsec/enc/XSECCryptoKey.hpp>
00032 
00045 class DSIG_EXPORT XSECCryptoKeyRSA : public XSECCryptoKey {
00046 
00047 public :
00048 
00055     enum PaddingType {
00056 
00057         PAD_NONE        = 0,        
00058         PAD_PKCS_1_5    = 1,        
00059         PAD_OAEP_MGFP1  = 2         
00061     };
00062 
00065 
00066     XSECCryptoKeyRSA() {};
00067     virtual ~XSECCryptoKeyRSA() {};
00068 
00070 
00073 
00081     virtual XSECCryptoKey::KeyType getKeyType() {return KEY_NONE;}
00082     
00087     virtual XSECCryptoKey * clone() = 0;
00088 
00090 
00096 
00110     virtual void setOAEPparams(unsigned char * params, unsigned int paramsLen) = 0;
00111 
00118     virtual unsigned int getOAEPparamsLen(void) = 0;
00119 
00127     virtual const unsigned char * getOAEPparams(void) = 0;
00128 
00142     virtual bool verifySHA1PKCS1Base64Signature(const unsigned char * hashBuf, 
00143                                  unsigned int hashLen,
00144                                  const char * base64Signature,
00145                                  unsigned int sigLen) = 0;
00146 
00166     virtual unsigned int signSHA1PKCS1Base64Signature(unsigned char * hashBuf,
00167         unsigned int hashLen,
00168         char * base64SignatureBuf,
00169         unsigned int base64SignatureBufLen) = 0;
00170 
00186     virtual unsigned int privateDecrypt(const unsigned char * inBuf,
00187                                  unsigned char * plainBuf, 
00188                                  unsigned int inLength,
00189                                  unsigned int maxOutLength,
00190                                  PaddingType padding,
00191                                  hashMethod hm) = 0;
00192 
00209     virtual unsigned int publicEncrypt(const unsigned char * inBuf,
00210                                  unsigned char * cipherBuf, 
00211                                  unsigned int inLength,
00212                                  unsigned int maxOutLength,
00213                                  PaddingType padding,
00214                                  hashMethod hm) = 0;
00215 
00222     virtual unsigned int getLength(void) = 0;
00223 
00225 
00237 
00247     virtual void loadPublicModulusBase64BigNums(const char * b64, unsigned int len) = 0;
00248 
00258     virtual void loadPublicExponentBase64BigNums(const char * b64, unsigned int len) = 0;
00259 
00261 
00262 };
00263 
00264 
00265 
00266 #endif /* XSECCRYPTOKEYRSA_INCLUDE */

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