예제 #1
0
 def __init__(self,pub=None,priv=None,size=1024):
     if not pub and not priv:
         print 'generating'
         keypair =  cm.createRSAKeyPair(size)
         private = keypair.private()
         public = keypair.public()
     self.privateKey = FastKey(private)
     self.publicKey = FastKey(public)
예제 #2
0
    def __init__(self,pub=None,priv=None,size=1024):
        if not pub and not priv:
            import crypto_mathew as cm
            keypair =   cm.createRSAKeyPair(size)
            key = keypair.key
            priv = {'d': key.d, 'p': key.p, 'q': key.n}
            pub = {'e': key.e, 'n': key.n}

        self.privateKey = SimplePublicKey(pub)
        self.publicKey = SimplePrivateKey(priv)