def get_ca_signed_key(ca_name, CN='localhost', as_text=False, cacert_path=None, key_filename=None):
 set_ca_path(cacert_path)
 if (not key_filename):
  key_filename = CN
 keyp = '{0}/{1}/certs/{2}.key'.format(cert_base_path(), ca_name, key_filename)
 if (not os.path.exists(keyp)):
  raise ValueError('Certificate does not exists for {0}'.format(CN))
 elif as_text:
  with salt.utils.fopen(keyp) as fic:
   keyp = fic.read()
 return keyp

def get_ca_signed_key ( ca_name , CN = 'localhost' , as_text = False , cacert_path = None , key_filename = None ) : set_ca_path ( cacert_path ) if ( not key_filename ) : key_filename = CN keyp = '{0}/{1}/certs/{2}.key' . format ( cert_base_path ( ) , ca_name , key_filename ) if ( not os . path . exists ( keyp ) ) : raise ValueError ( 'Certificate does not exists for {0}' . format ( CN ) ) elif as_text : with salt . utils . fopen ( keyp ) as fic : keyp = fic . read ( ) return keyp
get the certificate path or content ca_name name of the ca cn common name of the certificate as_text if true .