I have tried encrypting a private key, but I simply can not get it working.
I use MS Visual C++ 6.0 on a NT 4 SP4 PC.
I have tried implementing a callback function as shown below, but the
callback function is never called.
Does anyone have a small code example with just this functionality:
* Generate private RSA key
* Encrypt the key
* Save it to disk.
TIA,
Kim Hellan
> -----Oprindelig meddelelse-----
> Fra: [EMAIL PROTECTED]
> [SMTP:[EMAIL PROTECTED]]
> Sendt: 13. juli 1999 17:13
> Til: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Emne: Encryption of private key
>
> PEM_read_bio_PrivateKey(BIO *KeyFile ,NULL,yourcallback)
>
> where yourcallback is :
> static int MS_CALLBACK yourcallback(char *buf, int num, int verify)
> {
>
> strncpy(buf,yourhardcodedpassword,num-1);
> return(strlen(buf));
>
> }
>
> ;>
>
>
> > I'm using OpenSSL 0.9.2....
> > I use PEM_read_PrivateKey() / PEM_write_PrivateKey() to read/write my
> > private key from/to a diskette. I would like encrypt/decrypt the key
> when
> > writing/reading to/from the diskette.
> > I'm only looking for a "simple" encryption with a key hardcoded in to
> my
> > application.
> >
> > Can this be done using OpenSSL ?
> >
> > I know the answer is probably yes :-) so if anyone could give me an
> example
> > of how to do this, I would really appreciate it.
> >
> > > Best regards
> > >
> > > Kim Hellan
>
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]