PyKMIP is a Python implementation of the Key Management Interoperability Protocol (KMIP), a client/server communication protocol for the storage and maintenance of key, certificate, and secret objects. PyKMIP provides a Python client and server implementation of the KMIP 1.1 specification, supporting basic lifecycle operations for the primary KMIP object types.
1.Enter this command to install PyKMIP:
sudo pip install PyKMIP==0.4.0
2.Run the server program shown below with this command:
python pykmip_server.py
#!/usr/bin/python
# this file is a thin wrapper around the PyKMIP server
# which is required for some encrypted storage engine tests
import logging
from kmip.services.kmip_server import KMIPServer
def main():
logger = logging.getLogger(__name__)
server = KMIPServer(
host="192.168.31.200",
port=5696,
keyfile="/home/vagrant/shared/certs/server.pem",
certfile="/home/vagrant/shared/certs/server.pem",
cert_reqs="CERT_REQUIRED",
ssl_version="PROTOCOL_TLSv1",
ca_certs="/home/vagrant/shared/certs/ca.pem",
do_handshake_on_connect=True,
suppress_ragged_eofs=True)
logger.info("Starting KMIP server")
try:
server.serve()
except Exception as e:
logger.info('Exception received while serving: {0}'.format(e))
finally:
server.close()
logger.info("Stopping KMIP server")
if __name__ == '__main__':
main()