def parse_private_key(s):
 if pemSniff(s, 'PRIVATE KEY'):
  bytes = dePem(s, 'PRIVATE KEY')
  return _parsePKCS8(bytes)
 elif pemSniff(s, 'RSA PRIVATE KEY'):
  bytes = dePem(s, 'RSA PRIVATE KEY')
  return _parseSSLeay(bytes)
 else:
  raise SyntaxError('Not a PEM private key file')

def parse_private_key ( s ) : if pemSniff ( s , 'PRIVATE KEY' ) : bytes = dePem ( s , 'PRIVATE KEY' ) return _parsePKCS8 ( bytes ) elif pemSniff ( s , 'RSA PRIVATE KEY' ) : bytes = dePem ( s , 'RSA PRIVATE KEY' ) return _parseSSLeay ( bytes ) else : raise SyntaxError ( 'Not a PEM private key file' )
parse a string containing a pem-encoded <privatekey> .