try {
PrivateKey privKey = SOSKeyGenerator.getPrivateKeyFromFile(privateKeyFileName);
PublicKey pubKey = SOSKeyGenerator.getPublicKeyFromFile(publicKeyFileName);
SOSCertificate.setHashAlgorithm(SOSCertificate.SHA1);
//SOSCertificate.setHashAlgorithm(SOSCertificate.MD2);
//SOSCertificate.setHashAlgorithm(SOSCertificate.MD5);
//OU,DC=com
// ohne CN bei SubjectDN - zeigt Signed by Unknown
// ausgestellt f�r
//SOSCertificate.setSubjectDN("CN=Robert Ehrlich,C=DE,O=APL/SOS");
// wenn sich subject von issuer unterscheiden dann ...
SOSCertificate.setSubjectDN("CN=Andreas Liebert,C=DE,O=APL/SOS");
//ausgestellt von
SOSCertificate.setIssuerDN("CN=Andreas Liebert,C=DE,O=APL/SOS");
SOSCertificate.setSerialNumber(BigInteger.valueOf(100));
String certFile = privKey.getAlgorithm()+"("+provider+")="+SOSCertificate.getHashAlgorithm()+".cer";
SOSCertificate.generateCertificate(privKey, pubKey, path + certFile);
System.out.println("Zertifikate wurde erstellt");
System.out.println("privKey = "+privateKeyFileName);