Changes between Version 3 and Version 4 of WikiStart


Ignore:
Timestamp:
May 17, 2013 9:34:21 AM (8 years ago)
Author:
faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v3 v4  
    151151
    152152print "%s %s" % (id1.keyid(), id2.keyid())
     153}}}
     154
     155The {{{write_cert}}} and {{{write_cert_name}}} methods write the X.509 certificate from an identity.  The private keys can similarly be read or written using {{{read_privkey_name}}} and {{{read_privkey}}}.  The following snippet creates an identity, writes it to 2 files and reads it from those files printing the results.  The output files will not contain the private key.
     156
     157{{{
     158
     159import ABAC
     160
     161id = ABAC.ID("newGuy", 5*365*3600*24)
     162
     163id.write_cert_name("./newGuy.pem")
     164
     165id1 = ABAC.ID("./newGuy.pem")
     166
     167try:
     168    f = open("./newGuy.pem")
     169    id2 = ABAC.ID_chunk(f.read())
     170    f.close()
     171except:
     172    pass
     173
     174print "%s %s %s" % (id.keyid(), id1.keyid(), id2.keyid())
    153175
    154176
    155177}}}
    156 
    157178
    158179== Contacts ==