Re: M2Crypto: Loading own cert and key from BIO
Latitia Haskins <[email protected]>
| Newsgroups | gmane.comp.python.cryptography |
|---|---|
| Message-ID | <[email protected]> |
Hi Egil, I'm not sure about the version that you listed (typo maybe?). If I am understanding your question correctly, you want to look at the load_cert_chain() method in the Context class. It takes the filename where the certificate is stored. Latitia On 3/15/07, Egil Möller <[email protected]> wrote: > > Hi! > In modern M2Crypto:s (0.1.16) you can load certificates (including CA > cert) to use to verify the peer's cert into a context from e.g. a > database with: > > def loadCert(ctx, certDataAsString): > store = ctx.get_cert_store() > bio = M2Crypto.BIO.MemoryBuffer() > bio.write(certDataAsString) > store.add_x509(M2Crypto.X509.load_cert_bio(bio)) > > But how do you load your own cert and key from a string, that is, a call > analogous to ctx.load_cert(filename)? > > I am developing a peer-to-peer protocol, and would like to store > everything at a node in its database, even the certificate and key for > the node. > > Thanks in advance, > Egil Möller > >