public static org.opcfoundation.ua.transport.security.KeyPair createHttpsCertificate(String hostName,String applicationUri,int days,org.opcfoundation.ua.transport.security.KeyPair issuerCert) throws IOException, GeneralSecurityException {
  if (applicationUri == null)   throw new NullPointerException("applicationUri must not be null");
  if (logger.isDebugEnabled())   logger.debug("createApplicationInstanceCertificate: getProviders={}",Arrays.toString(Security.getProviders()));
  KeyPair keyPair=generateKeyPair();
  X509Certificate cert;
  cert=generateCertificate("CN=" + hostName,days,applicationUri,keyPair.getPublic(),keyPair.getPrivate(),issuerCert);
  return toKeyPair(cert,keyPair.getPrivate());
}

public static org . opcfoundation . ua . transport . security . KeyPair createHttpsCertificate ( String hostName , String applicationUri , int days , org . opcfoundation . ua . transport . security . KeyPair issuerCert ) throws IOException , GeneralSecurityException { if ( applicationUri == null ) throw new NullPointerException ( "applicationUri must not be null" ) ; if ( logger . isDebugEnabled ( ) ) logger . debug ( "createApplicationInstanceCertificate: getProviders={}" , Arrays . toString ( Security . getProviders ( ) ) ) ; KeyPair keyPair = generateKeyPair ( ) ; X509Certificate cert ; cert = generateCertificate ( "CN=" + hostName , days , applicationUri , keyPair . getPublic ( ) , keyPair . getPrivate ( ) , issuerCert ) ; return toKeyPair ( cert , keyPair . getPrivate ( ) ) ; }
create a new certificate that can be used with the https protocol . the certificate should be issued with a ca certificate , especially for the server applications , to ensure interoperability with other client applications .
