Nevermind, figured it out -- turns out that GCC doesn't like taking a 
reference to a temporary whereas MSVC was ok with it.

On Wednesday, September 12, 2012 9:09:31 PM UTC-7, Stu wrote:
>
> In the following testcase, I simply generate an RSA public key and attempt 
> to save to a file.  
>
> I have tested this code on windows and it works flawlessly (5.6.1).  
> However, I get a compilation error under linux (also version 5.6.1).  I get 
> this compilation error whenever I try to use Save or Load function on 
> RSAFunction or InvertibleRSAFunction.  
>
> I have inspected the source code and it appears that these functions 
> should indeed be inherited from the ASN1CryptoMaterial base class in asn.h, 
> and I can't figure out why it won't compile.
>
> ----
> #include "cryptopp/cryptlib.h"
> #include "cryptopp/osrng.h"
> #include "cryptopp/modes.h"
> #include "cryptopp/integer.h"
> #include "cryptopp/base64.h"
> #include "cryptopp/rsa.h"
> #include "cryptopp/files.h"
>
> int main()
> {
>     using namespace CryptoPP;
>
>     RSA::PrivateKey privateKey;
>
>     //generate public private keypair...
>     AutoSeededRandomPool rng;
>     privateKey.GenerateRandomWithKeySize(rng, 2048);
>     RSA::PublicKey publicKey(privateKey);    
>
>     // Save as X.509 (using ASN.1 DER Encoding )
>     publicKey.Save( FileSink("public.key") );
>     //main.cpp:21: error: no matching function for call to 
> âCryptoPP::RSAFunction::Save(CryptoPP::FileSink)â
>
> }
>
> //g++ main.cpp -o test -Wfatal-errors -lcryptopp
> ----------
>

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to