<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Hi Olivier,</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">The currently released version (0.7.2) does not support saving the keys, but 0.8 (which should be out in the next few days) will support it via "private_bytes" (https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/#cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization.private_bytes). At that point when you call rsa.generate_private_key() you can verify you get back an object with the RSAPrivateKeyWithSerialization interface by calling isinstance(key, rsa.RSAPrivateKeyWithSerialization).</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">-Paul Kehrer</div> <div id="bloop_sign_1425742244326510080" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px"><br></div></div> <br><p style="color:#000;">On March 7, 2015 at 8:59:44 AM, olivier sallou (<a href="mailto:olivier.sallou@gmail.com">olivier.sallou@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>



<title></title>


<div dir="ltr">Hi,
<div>I followed examples to create an rsa (public/private) key and
it works fine.</div>
<div>I do not see however how to "save" my keys for later
reuse/exchange.</div>
<div><br></div>
<div>I see no "export/convertt to bytes" method to save keys in a
file.</div>
<div><br></div>
<div>In documentation, there are references
to RSAPrivateKeyWithSerialization but I do not see how to get
one from rsa.generate_private_key().</div>
<div><br></div>
<div>Could you help me?</div>
<div><br></div>
<div>Thanks</div>
<div><br></div>
<div>Olivier</div>
</div>


_______________________________________________
<br>Cryptography-dev mailing list
<br>Cryptography-dev@python.org
<br>https://mail.python.org/mailman/listinfo/cryptography-dev
<br></div></div></span></blockquote></body></html>