def parsePEMKey(s, private=False, public=False, passwordCallback=None, implementations=['openssl', 'python']):
 for implementation in implementations:
  if ((implementation == 'openssl') and cryptomath.m2cryptoLoaded):
   key = OpenSSL_RSAKey.parse(s, passwordCallback)
   break
  elif (implementation == 'python'):
   key = Python_RSAKey.parsePEM(s)
   break
 else:
  raise ValueError('No acceptable implementations')
 return _parseKeyHelper(key, private, public)

def parsePEMKey ( s , private = False , public = False , passwordCallback = None , implementations = [ 'openssl' , 'python' ] ) : for implementation in implementations : if ( ( implementation == 'openssl' ) and cryptomath . m2cryptoLoaded ) : key = OpenSSL_RSAKey . parse ( s , passwordCallback ) break elif ( implementation == 'python' ) : key = Python_RSAKey . parsePEM ( s ) break else : raise ValueError ( 'No acceptable implementations' ) return _parseKeyHelper ( key , private , public )
parse a pem-format key .