Difference between revisions of "PKI 10.8 Python Changes"

From Dogtag
Jump to: navigation, search
(Created page with "= pki.client.PKIConnection = Previously the subsystem name had to be specified when creating the connection object, limiting the use of the connection object to a specific su...")
 
m (pki.client.PKIConnection)
Line 1: Line 1:
= pki.client.PKIConnection =
+
= Changes in PKIConnection =
  
 
Previously the subsystem name had to be specified when creating the connection object,
 
Previously the subsystem name had to be specified when creating the connection object,
Line 5: Line 5:
  
 
<pre>
 
<pre>
ca_connection = PKIConnection(subsystem='ca')
+
ca_connection = PKIConnection(hostname='localhost', port='8080', subsystem='ca')
 
cert_client = CertClient(ca_connection)
 
cert_client = CertClient(ca_connection)
 +
certs = ca_connection.get('/rest/certs')
  
kra_connection = PKIConnection(subsystem='kra')
+
kra_connection = PKIConnection(hostname='localhost', port='8080', subsystem='kra')
 
key_client = KeyClient(kra_connection)
 
key_client = KeyClient(kra_connection)
 +
keys = kra_connection.get('/rest/keys')
 
</pre>
 
</pre>
  
Line 16: Line 18:
  
 
<pre>
 
<pre>
connection = PKIConnection()
+
connection = PKIConnection(hostname='localhost', port='8080')
 +
 
 
cert_client = CertClient(connection, subsystem='ca')
 
cert_client = CertClient(connection, subsystem='ca')
 +
certs = connection.get('/ca/rest/certs')
 +
 
key_client = KeyClient(kra_connection, subsystem='kra')
 
key_client = KeyClient(kra_connection, subsystem='kra')
 +
keys = connection.get('/kra/rest/keys')
 
</pre>
 
</pre>
  

Revision as of 16:23, 9 September 2019

Changes in PKIConnection

Previously the subsystem name had to be specified when creating the connection object, limiting the use of the connection object to a specific subsystem only. For example:

ca_connection = PKIConnection(hostname='localhost', port='8080', subsystem='ca')
cert_client = CertClient(ca_connection)
certs = ca_connection.get('/rest/certs')

kra_connection = PKIConnection(hostname='localhost', port='8080', subsystem='kra')
key_client = KeyClient(kra_connection)
keys = kra_connection.get('/rest/keys')

Since PKI 10.8 the subsystem should be specified when creating the objects instead, allowing the connection object to be used with various subsystems. For example:

connection = PKIConnection(hostname='localhost', port='8080')

cert_client = CertClient(connection, subsystem='ca')
certs = connection.get('/ca/rest/certs')

key_client = KeyClient(kra_connection, subsystem='kra')
keys = connection.get('/kra/rest/keys')

See Also