It's called twice when writing keys IIRC. Something to do with verifying 
the user input is correct.


On 31 March 2014 19:43:31 David Reid <notifications@github.com> wrote:

> > @@ -376,6 +405,34 @@ def _rsa_cdata_to_private_key(self, cdata):
> >              modulus=self._bn_to_int(cdata.n),
> >          )
> > +    def _pem_password_cb(self, password):
> > +        """
> > +        Generate a pem_password_cb that returns password
> > +
> > +        typedef int pem_password_cb(char *buf, int size,
> > +                                    int rwflag, void *userdata);
> > +
> > +        suitable for decrypting PKCS8 files and so on
> > +        """
> > +
> > +        def pem_password_cb(buf, size, writing, userdata):
> > +            pem_password_cb.called += 1
>
> Do we ever care if this >1?
>
> If not it should just be a bool?
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/pyca/cryptography/pull/627/files#r11130249