Try this:
RSASSA_PKCS1v15_SHA_Signer PrivateK(
FileSource(SKey.data(),true,new Base64Decoder()));
or
RSASSA_PKCS1v15_SHA_Signer PrivateK;
PrivateK.AccessKey().BERDecode(FileSource(SKey.data(),true,new
Base64Decoder()));
On Fri, Nov 05, 2004 at 11:13:12AM +0100, Benoit LEFEVRE wrote:
> Hello,
>
> This look likes a cast problem, but I don't have it when I build it
> with VS.NET 2003.
> Conversion from CryptoPP::FileSource to non scalar type
> CryptoPP::PK_FinalTemplate...
>
> (No problems with cryptext.exe)
>
> Thanks,
> Benoit LEFEVRE
>
> ---------------------------------------------------------------------------------------------------------
> SOURCE CODE:
>
> string Job::md5(const char * nom_fichier)
> {
> try
> {
> string SKey = "./security/ServiceSign.pri";
>
> PRINT_DEBUG("Make file Signature");
> AutoSeededRandomPool rng;
> std::string Signature;
> RSASSA_PKCS1v15_SHA_Signer PrivateK =
> FileSource(SKey.data(),true,new Base64Decoder());
>
> FileSource(nom_fichier,true,new SignerFilter(rng,PrivateK,new
> Base64Encoder(new StringSink(Signature),false)));
> return Signature;
> }
> catch(FileStore::OpenErr e)
> {
> LOG4CPLUS_ERROR(Log_System,e.what());
> exit(-1);
> }
> catch(Exception e)
> {
> LOG4CPLUS_ERROR(Log_System,e.what());
> return "";
> }
> }
> ---------------------------------------------------------------------------------------------------------------
> ERROR MESSAGE:
> Job.cpp: Dans member function � std::string Job::md5(const char*) �:
> Job.cpp:211: conversion de � CryptoPP::FileSource � vers un type non scalaire
> �
> CryptoPP::PK_FinalTemplate<CryptoPP::TF_SignerImpl<CryptoPP::TF_SignatureSchemeOptions<CryptoPP::TF_SS<CryptoPP::PKCS1v15,
> CryptoPP::SHA, CryptoPP::RSA, int>, CryptoPP::RSA,
> CryptoPP::PKCS1v15_SignatureMessageEncodingMethod, CryptoPP::SHA> > > �
> demand�e
> make: *** [agent-Job.o] Erreur 1
> ---------------------------------------------------------------------------------------------------------------
> BUILD COMMAND:
> source='Job.cpp' object='agent-Job.o' libtool=no \
> depfile='.deps/agent-Job.Po' tmpdepfile='.deps/agent-Job.TPo' \
> depmode=gcc3 /bin/sh ./depcomp \
> g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
> -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"agent\"
> -DVERSION=\"0.1\" -I. -I. -pipe -Os -DLIBXML_STATIC -DLOG4CPLUS_STATIC
> -DBOOST_HAS_THREADS -Wall -Wno-deprecated -fmessage-length=0 -D_AGENT -g -O2
> -c -o agent-Job.o `test -f 'Job.cpp' || echo './'`Job.cpp
> ---------------------------------------------------------------------------------------------------------------
> MY CONFIG:
> Lecture des sp�cification � partir de
> /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs
> Configur� avec: ../configure --prefix=/usr --mandir=/usr/share/man
> --infodir=/usr/share/info --enable-shared --enable-threads=posix
> --disable-checking --with-system-zlib --enable-__cxa_atexit
> --host=i386-redhat-linux
> Mod�le de thread: posix
> version gcc 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
> Linux 2.4.27 #10 jeu sep 2 15:51:06 CEST 2004 i686 athlon i386 GNU/Linux
> ---------------------------------------------------------------------------------------------------------