book
Article ID: KB0070536
calendar_today
Updated On:
Description
You can use the following database queries to identify what transports/business agreements a private key is attached to. Please Note that the below queries ran against the Oracle database, you might have to modify the syntax to use against the SQL server or as per the vendor database in use. I attached sample results of the queries for your reference.
Issue/Introduction
How do I identify what transports/business agreements a private key is attached to?
Resolution
/* get partner name by private key name */
SELECT a.OBJNID as partnerName, a.CATEGORY
FROM bc74.bc_participant a, bc74.bc_keystoreitem b
where a.OBJOID = b.OWNER_OID and b.OBJNID = "bcpartner2_key.p12";
/* transport which use the private key */
SELECT a.OBJNID as transport, c.OBJNID as proptocol, d.OBJNID as partner
FROM bc74.bc_channelinfo a, bc74.bc_keystoreitem b, bc74.bc_protocol c, bc74.bc_participant d
where a.KEY_OID = b.OBJOID and b.OBJNID = "bcpartner2_key.p12"
and a.OWNER_OID = c.OBJOID and c.OWNER_OID = d.OBJOID;
/* bizagreement which enable inbound transport with the private key*/
SELECT a.OBJNID as IB_transport, d.OBJNID as proptocolBinding, c.DISPLAY_NAME as bizagreement
FROM bc74.bc_channelinfo a, bc74.bc_keystoreitem b, bc74.bc_bizagreement c, bc74.bc_pb d, bc74.bc_pbv e
where a.KEY_OID = b.OBJOID and b.OBJNID = "bcpartner2_key.p12"
and a.OWNER_OID = e.OBJOID and e.OWNER_OID = d.OBJOID and d.OWNER_OID = c.OBJOID;
/* bizagreement which refer the private key in Transport Tab*/
SELECT a.DISPLAY_NAME as bizagreement
FROM bc74.bc_bizagreement a, bc74.bc_pb b, bc74.bc_pbv c
where c.OWNER_OID = b.OBJOID and b.OWNER_OID = a.OBJOID
/* bizagreement directly use this cert in Transport Tab */
and (c.KEY_OID in (SELECT OBJOID FROM bc74.bc_keystoreitem where OBJNID = "bcpartner2_key.p12")
or c.KEY2_OID in (SELECT OBJOID FROM bc74.bc_keystoreitem where OBJNID = "bcpartner2_key.p12"));
/* bizagreement which refer the private key in Document Security Tab*/
SELECT a.DISPLAY_NAME as bizagreement, b.OBJNID as proptocolBinding
FROM bc74.bc_bizagreement a, bc74.bc_pb b, bc74.bc_pbv c
where c.OWNER_OID = b.OBJOID and b.OWNER_OID = a.OBJOID
/* bizagreement directly use this cert in Transport Tab */
and c.OBJOID in (select d.OWNER_OID
from bc74.bc_docexchange d, bc74.bc_securityinfo e, bc74.bc_keystoreitem f
where f.OBJNID = "bcpartner2_key.p12" and e.CRED_OID = f.OBJOID
and e.OWNER_OID = d.OBJOID);