Difference between revisions of "PKI 10.8 Python Changes"

From Dogtag
Jump to: navigation, search
m
m (Changes in PKIConnection)
Line 7: Line 7:
 
<pre>
 
<pre>
 
ca_connection = PKIConnection(hostname='localhost', port='8080', subsystem='ca')
 
ca_connection = PKIConnection(hostname='localhost', port='8080', subsystem='ca')
 +
kra_connection = PKIConnection(hostname='localhost', port='8080', subsystem='kra')
 +
 
certs = ca_connection.get('/rest/certs')
 
certs = ca_connection.get('/rest/certs')
 +
keys = kra_connection.get('/rest/keys')
 +
 
cert_client = CertClient(ca_connection)
 
cert_client = CertClient(ca_connection)
 
kra_connection = PKIConnection(hostname='localhost', port='8080', subsystem='kra')
 
keys = kra_connection.get('/rest/keys')
 
 
key_client = KeyClient(kra_connection)
 
key_client = KeyClient(kra_connection)
 
</pre>
 
</pre>

Revision as of 16:36, 9 September 2019

Changes in PKIConnection

Previously PKIConnection object has to be created for a specific subsystem, limiting its use to that subsystem only. Also, the URL path for get(), post(), put(), delete() has to be a relative path. For example:

ca_connection = PKIConnection(hostname='localhost', port='8080', subsystem='ca')
kra_connection = PKIConnection(hostname='localhost', port='8080', subsystem='kra')

certs = ca_connection.get('/rest/certs')
keys = kra_connection.get('/rest/keys')

cert_client = CertClient(ca_connection)
key_client = KeyClient(kra_connection)

Since PKI 10.8 the subsystem should be specified when creating the objects. The URL path for get(), post(), put(), delete() has to be an absolute path. This allows the connection object to be used with various subsystems. For example:

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

certs = connection.get('/ca/rest/certs')
keys = connection.get('/kra/rest/keys')

cert_client = CertClient(connection, subsystem='ca')
key_client = KeyClient(connection, subsystem='kra')

See Also