Exemplo n.º 1
0
Arquivo: test_pbp.py Projeto: stef/pbp
 def test_keysign(self):
     publickey.Identity('alice', basedir=self.pbp_path, create=True)
     publickey.Identity('bob', basedir=self.pbp_path, create=True)
     pbp.keysign_handler(name='bob', self='alice', basedir=self.pbp_path)
     sigs=pbp.keycheck_handler(name='bob', basedir=self.pbp_path)
     self.assertEquals(sigs, ['alice'])
Exemplo n.º 2
0
Arquivo: main.py Projeto: fpletz/pbp
            print >>sys.stderr, 'verification failed'

    # key sign
    elif opts.action=='m':
        ensure_name_specified(opts)
        ensure_self_specified(opts)
        sig = keysign_handler(name=opts.name,
                              self=opts.self,
                              basedir=opts.basedir)
        if sig: print "key signed in", sig
        else: print >>sys.stderr, 'signature failed'

    # lists signatures owners on public keys
    elif opts.action=='C':
        ensure_name_specified(opts)
        sigs = keycheck_handler(name=opts.name,
                         basedir=opts.basedir)
        if sigs:
            print >>sys.stderr, 'good signatures on', opts.name, 'from', ', '.join(sigs)
        else: print >>sys.stderr, 'no good sigs found'

    # export public key
    elif opts.action=='x':
        ensure_self_specified(opts)
        k = export_handler(opts.self,
                           basedir=opts.basedir)
        print k
    # import public key
    elif opts.action=='X':
        n = import_handler(infile=opts.infile,
                           basedir=opts.basedir)
        if n:
Exemplo n.º 3
0
            print >>sys.stderr, '[pbp] VERIFICATION FAILED'

    # key sign
    elif opts.action=='m':
        ensure_name_specified(opts)
        ensure_self_specified(opts)
        sig = keysign_handler(name=opts.name,
                              self=opts.self,
                              basedir=opts.basedir)
        if sig: print "[pbp] key signed in", sig
        else: print >>sys.stderr, '[pbp] SIGNATURE FAILED'

    # lists signatures owners on public keys
    elif opts.action=='C':
        ensure_name_specified(opts)
        sigs = keycheck_handler(name=opts.name,
                         basedir=opts.basedir)
        if sigs:
            print >>sys.stderr, '[pbp] good signatures on', opts.name, 'from', ', '.join(sigs)
        else: print >>sys.stderr, '[pbp] NO GOOD SIGS FOUND'

    # export public key
    elif opts.action=='x':
        ensure_self_specified(opts)
        k = export_handler(opts.self,
                           basedir=opts.basedir)
        print k
    # import public key
    elif opts.action=='i':
        n = import_handler(infile=opts.infile,
                           basedir=opts.basedir)
        if n:
Exemplo n.º 4
0
 def test_keysign(self):
     publickey.Identity('alice', basedir=self.pbp_path, create=True)
     publickey.Identity('bob', basedir=self.pbp_path, create=True)
     pbp.keysign_handler(name='bob', self='alice', basedir=self.pbp_path)
     sigs = pbp.keycheck_handler(name='bob', basedir=self.pbp_path)
     self.assertEquals(sigs, ['alice'])