/*SIMPLE MQePublicRegistry shareCertificate FRAGMENT */ try { String EntityName = "Bruce"; String EntityPIN = "12345678"; Object KeyRingPassword = "It_is_a_secret"; Object CertReqPIN = "12345678"; Object CAIPAddrPort = "9.20.X.YYY:8082"; /*instantiate and activate PublicReg */ MQePublicRegistry pubreg = new MQePublicRegistry(); pubreg.activate("MQeNode_PublicRegistry",".\\"); /* auto-register Bruce1,Bruce2...Bruce8 */ /* ... note that the mini-certificate issuance service must */ /* have been configured to allow the auto-registration */ for (int i = 1; i < 9; i++) { EntityName = "Bruce"+(new Integer(i)).toString(); MQePrivateRegistry preg = new MQePrivateRegistry(); /* activate() will initiate auto-registration */ preg.activate(EntityName, ".\\MQeNode_PrivateRegistry", EntityPIN, KeyRingPassword, CertReqPIN, CAIPAddrPort); /* save MiniCert from PrivReg in PubReg*/ pubreg.putCertificate(EntityName, preg.getCertificate(EntityName )); /*before share of MiniCert */ pubreg.shareCertificate(EntityName, preg.getCertificate(EntityName ),"9.20.X.YYY:8082"); preg.close(); } pubreg.close(); } catch (Exception e) { e.printStackTrace(); }
Notes: