def get_extensions(cert_type):
 assert X509_EXT_ENABLED, 'X509 extensions are not supported in pyOpenSSL prior to version 0.15.1. Your version: {0}'.format(OpenSSL_version)
 ext = {}
 if (cert_type == ''):
  log.error('cert_type set to empty in tls_ca.get_extensions(); defaulting to ``server``')
  cert_type = 'server'
 try:
  ext['common'] = __salt__['pillar.get']('tls.extensions:common', False)
 except NameError as err:
  log.debug(err)
 if ((not ext['common']) or (ext['common'] == '')):
  ext['common'] = {'csr': {'basicConstraints': 'CA:FALSE'}, 'cert': {'authorityKeyIdentifier': 'keyid,issuer:always', 'subjectKeyIdentifier': 'hash'}}
 try:
  ext['server'] = __salt__['pillar.get']('tls.extensions:server', False)
 except NameError as err:
  log.debug(err)
 if ((not ext['server']) or (ext['server'] == '')):
  ext['server'] = {'csr': {'extendedKeyUsage': 'serverAuth', 'keyUsage': 'digitalSignature, keyEncipherment'}, 'cert': {}}
 try:
  ext['client'] = __salt__['pillar.get']('tls.extensions:client', False)
 except NameError as err:
  log.debug(err)
 if ((not ext['client']) or (ext['client'] == '')):
  ext['client'] = {'csr': {'extendedKeyUsage': 'clientAuth', 'keyUsage': 'nonRepudiation, digitalSignature, keyEncipherment'}, 'cert': {}}
 if (cert_type not in ext):
  try:
   ext[cert_type] = __salt__['pillar.get']('tls.extensions:{0}'.format(cert_type))
  except NameError as e:
   log.debug('pillar, tls:extensions:{0} not available or not operating in a salt context\n{1}'.format(cert_type, e))
 retval = ext['common']
 for Use in retval:
  retval[Use].update(ext[cert_type][Use])
 return retval

def get_extensions ( cert_type ) : assert X509_EXT_ENABLED , 'X509 extensions are not supported in pyOpenSSL prior to version 0.15.1. Your version: {0}' . format ( OpenSSL_version ) ext = { } if ( cert_type == '' ) : log . error ( 'cert_type set to empty in tls_ca.get_extensions(); defaulting to ``server``' ) cert_type = 'server' try : ext [ 'common' ] = __salt__ [ 'pillar.get' ] ( 'tls.extensions:common' , False ) except NameError as err : log . debug ( err ) if ( ( not ext [ 'common' ] ) or ( ext [ 'common' ] == '' ) ) : ext [ 'common' ] = { 'csr' : { 'basicConstraints' : 'CA:FALSE' } , 'cert' : { 'authorityKeyIdentifier' : 'keyid,issuer:always' , 'subjectKeyIdentifier' : 'hash' } } try : ext [ 'server' ] = __salt__ [ 'pillar.get' ] ( 'tls.extensions:server' , False ) except NameError as err : log . debug ( err ) if ( ( not ext [ 'server' ] ) or ( ext [ 'server' ] == '' ) ) : ext [ 'server' ] = { 'csr' : { 'extendedKeyUsage' : 'serverAuth' , 'keyUsage' : 'digitalSignature, keyEncipherment' } , 'cert' : { } } try : ext [ 'client' ] = __salt__ [ 'pillar.get' ] ( 'tls.extensions:client' , False ) except NameError as err : log . debug ( err ) if ( ( not ext [ 'client' ] ) or ( ext [ 'client' ] == '' ) ) : ext [ 'client' ] = { 'csr' : { 'extendedKeyUsage' : 'clientAuth' , 'keyUsage' : 'nonRepudiation, digitalSignature, keyEncipherment' } , 'cert' : { } } if ( cert_type not in ext ) : try : ext [ cert_type ] = __salt__ [ 'pillar.get' ] ( 'tls.extensions:{0}' . format ( cert_type ) ) except NameError as e : log . debug ( 'pillar, tls:extensions:{0} not available or not operating in a salt context\n{1}' . format ( cert_type , e ) ) retval = ext [ 'common' ] for Use in retval : retval [ Use ] . update ( ext [ cert_type ] [ Use ] ) return retval
return set of data data extensions .