/**
* @throws Exception if an error occurs...
*/
public void test02SSH() throws Exception {
certificateProfileSession.removeCertificateProfile(admin,"EXTKEYUSAGECERTPROFILE");
final EndUserCertificateProfile certprof = new EndUserCertificateProfile();
ArrayList<String> list = new ArrayList<String>();
certprof.setExtendedKeyUsage(list);
certificateProfileSession.addCertificateProfile(admin, "EXTKEYUSAGECERTPROFILE", certprof);
final int fooCertProfile = certificateProfileSession.getCertificateProfileId(admin,"EXTKEYUSAGECERTPROFILE");
endEntityProfileSession.removeEndEntityProfile(admin, "EXTKEYUSAGEEEPROFILE");
final EndEntityProfile profile = new EndEntityProfile(true);
profile.setValue(EndEntityProfile.AVAILCERTPROFILES,0,Integer.toString(fooCertProfile));
endEntityProfileSession.addEndEntityProfile(admin, "EXTKEYUSAGEEEPROFILE", profile);
final int fooEEProfile = endEntityProfileSession.getEndEntityProfileId(admin, "EXTKEYUSAGEEEPROFILE");
createOrEditUser(fooCertProfile, fooEEProfile);
X509Certificate cert = (X509Certificate) signSession.createCertificate(admin, "extkeyusagefoo", "foo123", rsakeys.getPublic());
assertNotNull("Failed to create certificate", cert);
//log.debug("Cert=" + cert.toString());
List<String> ku = cert.getExtendedKeyUsage();
assertNull(ku);
// Now add the SSH extended key usages
list.add("1.3.6.1.5.5.7.3.21"); // SSH client
list.add("1.3.6.1.5.5.7.3.22"); // SSH server
certprof.setExtendedKeyUsage(list);
certificateProfileSession.changeCertificateProfile(admin, "EXTKEYUSAGECERTPROFILE", certprof);
createOrEditUser(fooCertProfile, fooEEProfile);
cert = (X509Certificate) signSession.createCertificate(admin, "extkeyusagefoo", "foo123", rsakeys.getPublic());
assertNotNull("Failed to create certificate", cert);
//log.debug("Cert=" + cert.toString());