def get_ssh_certificate_tokens(module, ssh_cert_path):
 (rc, stdout, stderr) = module.run_command(['openssl', 'x509', '-in', ssh_cert_path, '-fingerprint', '-noout'])
 if (rc != 0):
  module.fail_json(msg=('failed to generate the key fingerprint, error was: %s' % stderr))
 fingerprint = stdout.strip()[17:].replace(':', '')
 (rc, stdout, stderr) = module.run_command(['openssl', 'pkcs12', '-export', '-in', ssh_cert_path, '-nokeys', '-password', 'pass:'])
 if (rc != 0):
  module.fail_json(msg=('failed to generate the pkcs12 signature from the certificate, error was: %s' % stderr))
 pkcs12_base64 = base64.b64encode(stdout.strip())
 return (fingerprint, pkcs12_base64)

def get_ssh_certificate_tokens ( module , ssh_cert_path ) : ( rc , stdout , stderr ) = module . run_command ( [ 'openssl' , 'x509' , '-in' , ssh_cert_path , '-fingerprint' , '-noout' ] ) if ( rc != 0 ) : module . fail_json ( msg = ( 'failed to generate the key fingerprint, error was: %s' % stderr ) ) fingerprint = stdout . strip ( ) [ 17 : ] . replace ( ':' , '' ) ( rc , stdout , stderr ) = module . run_command ( [ 'openssl' , 'pkcs12' , '-export' , '-in' , ssh_cert_path , '-nokeys' , '-password' , 'pass:' ] ) if ( rc != 0 ) : module . fail_json ( msg = ( 'failed to generate the pkcs12 signature from the certificate, error was: %s' % stderr ) ) pkcs12_base64 = base64 . b64encode ( stdout . strip ( ) ) return ( fingerprint , pkcs12_base64 )
returns the sha1 fingerprint and a base64-encoded pkcs12 version of the certificate .