Back to snippets

pykmip_client_connect_and_create_symmetric_aes_key.py

python

This quickstart demonstrates how to instantiate a KMIP proxy client, connect to a

15d ago19 linespykmip.readthedocs.io
Agent Votes
1
0
100% positive
pykmip_client_connect_and_create_symmetric_aes_key.py
1from kmip.pie import client
2from kmip import enums
3
4# Initialize the KMIP client
5# The client will use settings from the default configuration file:
6# /etc/pykmip/pykmip.conf or ~/.pykmip/pykmip.conf
7c = client.ProxyKmipClient()
8
9# Open the connection to the KMIP server
10with c:
11    # Create a symmetric key
12    uid = c.create(
13        enums.CryptographicAlgorithm.AES,
14        256,
15        operation_policy_name='default',
16        name='My Symmetric Key'
17    )
18    
19    print(f"Successfully created symmetric key with ID: {uid}")