Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations #
stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
"""Create a certificate signing environment.
This is based on a config section and reasonable OpenSSL defaults.
"""
'ca_cert': conf_obj.ca_certs, 'ssl_config': self.ssl_config_file_name, 'ca_private_key': conf_obj.ca_key, 'request_file': self.request_file_name, 'signing_key': conf_obj.keyfile, 'signing_cert': conf_obj.certfile, 'key_size': int(conf_obj.key_size), 'valid_days': int(conf_obj.valid_days), 'cert_subject': conf_obj.cert_subject, 'ca_password': conf_obj.ca_password}
os.chown(dir, -1, self.use_keystone_group)
os.chown(file_name, self.use_keystone_user or -1, self.use_keystone_group or -1)
'%(key_size)d') stat.S_IRUSR)
'-passin pass:%(ca_password)s ' '-key %(ca_private_key)s -out %(ca_cert)s ' '-days %(valid_days)d ' '-config %(ssl_config)s ' '-subj %(cert_subject)s')
'%(key_size)d ')
'-out %(request_file)s -config %(ssl_config)s ' '-subj %(cert_subject)s')
'-config %(ssl_config)s -days %(valid_days)dd ' '-cert %(ca_cert)s -keyfile %(ca_private_key)s ' '-infiles %(request_file)s')
"""Generate files for PKI signing using OpenSSL.
Signed tokens require a private key and signing certificate which itself must be signed by a CA. This class generates them with workable defaults if each of the files are not present
"""
keystone_user, keystone_group)
"""Generate files for HTTPS using OpenSSL.
Creates a public/private key and certificates. If a CA is not given one will be generated using provided arguments. """
keystone_user, keystone_group)
# OpenSSL configuration file. #
# Establish working directory.
dir = %(conf_dir)s
[ ca ] default_ca = CA_default
[ CA_default ] new_certs_dir = $dir serial = $dir/serial database = $dir/index.txt default_days = 365 default_md = sha1 preserve = no email_in_dn = no nameopt = default_ca certopt = default_ca policy = policy_anything x509_extensions = usr_cert unique_subject = no
[ policy_anything ] countryName = optional stateOrProvinceName = optional organizationName = optional organizationalUnitName = optional commonName = supplied emailAddress = optional
[ req ] default_bits = 1024 # Size of keys default_keyfile = key.pem # name of generated keys default_md = default # message digest algorithm string_mask = nombstr # permitted characters distinguished_name = req_distinguished_name req_extensions = v3_req
[ req_distinguished_name ] 0.organizationName = Organization Name (company) organizationalUnitName = Organizational Unit Name (department, division) emailAddress = Email Address emailAddress_max = 40 localityName = Locality Name (city, district) stateOrProvinceName = State or Province Name (full name) countryName = Country Name (2 letter code) countryName_min = 2 countryName_max = 2 commonName = Common Name (hostname, IP, or your name) commonName_max = 64
[ v3_ca ] basicConstraints = CA:TRUE subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer:always
[ v3_req ] basicConstraints = CA:FALSE subjectKeyIdentifier = hash
[ usr_cert ] basicConstraints = CA:FALSE subjectKeyIdentifier = hash authorityKeyIdentifier = keyid:always,issuer:always """ |