'A C{Crypto.PublicKey} object similar to this key.
As PyCrypto is no longer used for the underlying operations, this
property should be avoided.'

@property
@deprecated(Version('Twisted', 16, 0, 0))
def keyObject(self):

    from Crypto.PublicKey import DSA, RSA
    keyObject = None
    keyType = self.type()
    keyData = self.data()
    isPublic = self.isPublic()
    if (keyType == 'RSA'):
        if isPublic:
            keyObject = RSA.construct((keyData['n'], long(keyData['e'])))
        else:
            keyObject = RSA.construct((keyData['n'], long(keyData['e']), keyData['d'], keyData['p'], keyData['q'], keyData['u']))
    elif (keyType == 'DSA'):
        if isPublic:
            keyObject = DSA.construct((keyData['y'], keyData['g'], keyData['p'], keyData['q']))
        else:
            keyObject = DSA.construct((keyData['y'], keyData['g'], keyData['p'], keyData['q'], keyData['x']))
    else:
        raise BadKeyError('Unsupported    key    type.')
    return keyObject
