}
private String getAIKCertificateForHost(TblHosts tblHosts, TxtHost host) {
HostAgentFactory factory = new HostAgentFactory(); // we could call IntelHostAgentFactory but then we have to create the TlsPolicy object ourselves... the HostAgentFactory does that for us.
HostAgent agent = factory.getHostAgent(tblHosts);
if( agent.isAikAvailable() ) {
X509Certificate cert = agent.getAikCertificate();
try {
return X509Util.encodePemCertificate(cert);
}
catch(Exception e) {
log.error("Cannot encode AIK certificate: "+e.toString(), e);