'Computes the public key corresponding to the current private key.
:return:
For RSA keys, an RSAPublicKey object. For DSA keys, an Integer
object. For EC keys, an ECPointBitString.'

def _compute_public_key(self):

    if (self.algorithm == u'dsa'):
        params = self[u'private_key_algorithm'][u'parameters']
        return Integer(pow(params[u'g'].native, self[u'private_key'].parsed.native, params[u'p'].native))
    if (self.algorithm == u'rsa'):
        key = self[u'private_key'].parsed
        return RSAPublicKey({u'modulus': key[u'modulus'], u'public_exponent': key[u'public_exponent']})
    if (self.algorithm == u'ec'):
        (curve_type, details) = self.curve
        if (curve_type == u'implicit_ca'):
            raise ValueError(unwrap(u'\n                                                                                Unable    to    compute    public    key    for    EC    key    using    Implicit    CA\n                                                                                parameters\n                                                                                '))
        if (curve_type == u'specified'):
            if (details[u'field_id'][u'field_type'] == u'characteristic_two_field'):
                raise ValueError(unwrap(u'\n                                                                                                Unable    to    compute    public    key    for    EC    key    over    a\n                                                                                                characteristic    two    field\n                                                                                                '))
            curve = PrimeCurve(details[u'field_id'][u'parameters'], int_from_bytes(details[u'curve'][u'a']), int_from_bytes(details[u'curve'][u'b']))
            (base_x, base_y) = self[u'private_key_algorithm'][u'parameters'].chosen[u'base'].to_coords()
            base_point = PrimePoint(curve, base_x, base_y)
        elif (curve_type == u'named'):
            if (details not in (u'secp192r1', u'secp224r1', u'secp256r1', u'secp384r1', u'secp521r1')):
                raise ValueError(unwrap(u'\n                                                                                                Unable    to    compute    public    key    for    EC    named    curve    %s,\n                                                                                                parameters    not    currently    included\n                                                                                                ', details))
            base_point = {u'secp192r1': SECP192R1_BASE_POINT, u'secp224r1': SECP224R1_BASE_POINT, u'secp256r1': SECP256R1_BASE_POINT, u'secp384r1': SECP384R1_BASE_POINT, u'secp521r1': SECP521R1_BASE_POINT}[details]
        public_point = (base_point * self[u'private_key'].parsed[u'private_key'].native)
        return ECPointBitString.from_coords(public_point.x, public_point.y)
