def METHOD_NAME(self, secparam=1024, params=None):
    if params: 
        (N, e, d, p, q) = self.convert(params)
        phi_N = (p - 1) * (q - 1)
        pk = { 'N':N, 'e':e }
        sk = { 'phi_N':phi_N, 'd':d , 'N':N}
        return (pk, sk)
    (p, q, N, phi_N) = self.paramgen(secparam)
    while True:
        e = random(phi_N)
        if not gcd(e, phi_N) == 1:
            continue
        d = e ** -1
        break
    pk = { 'N':N, 'e':toInt(e) } # strip off \phi
    sk = { 'phi_N':phi_N, 'd':d , 'N':N}
    return (pk, sk)