#NEWLINE# def check( self ) : #NEWLINE# #INDENT# '\n        Check the consistency of an RSA private key.\n\n        :return: True if key is consistent.\n        :raise Error: if the key is inconsistent.\n        :raise TypeError: if the key is of a type which cannot be checked.\n            Only RSA keys can currently be checked.\n        ' #NEWLINE# if self . _only_public : #NEWLINE# #INDENT# raise TypeError ( 'public key only' ) #NEWLINE# #UNINDENT# if ( _lib . EVP_PKEY_type ( self . _pkey . type ) != _lib . EVP_PKEY_RSA ) : #NEWLINE# #INDENT# raise TypeError ( 'key type unsupported' ) #NEWLINE# #UNINDENT# rsa = _lib . EVP_PKEY_get1_RSA ( self . _pkey ) #NEWLINE# rsa = _ffi . gc ( rsa , _lib . RSA_free ) #NEWLINE# result = _lib . RSA_check_key ( rsa ) #NEWLINE# if result : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# _raise_current_error ( )