@@ -90,7 +90,7 @@ public class SAMLUtils {
9090 public static final String SAML_NS = "saml://" ;
9191 public static final String SAML_NAMEID = "SAML_NAMEID" ;
9292 public static final String SAML_SESSION = "SAML_SESSION" ;
93- public static final String CERTIFICATE_NAME = "SAMLSP_CERTIFICATE " ;
93+ public static final String CERTIFICATE_NAME = "SAMLSP_X509CERTIFICATE " ;
9494
9595 public static String createSAMLId (String uid ) {
9696 return SAML_NS + uid ;
@@ -207,20 +207,20 @@ public static Response decodeSAMLResponse(String responseMessage)
207207 return (Response ) unmarshaller .unmarshall (element );
208208 }
209209
210- public static X509Certificate generateRandomX509Certification () throws NoSuchAlgorithmException , NoSuchProviderException , CertificateEncodingException , SignatureException , InvalidKeyException {
210+ public static X509Certificate generateRandomX509Certificate () throws NoSuchAlgorithmException , NoSuchProviderException , CertificateEncodingException , SignatureException , InvalidKeyException {
211211 Date validityBeginDate = new Date (System .currentTimeMillis () - 24 * 60 * 60 * 1000 );
212- Date validityEndDate = new Date (System .currentTimeMillis () + 2 * 365 * 24 * 60 * 60 * 1000 );
212+ Date validityEndDate = new Date (System .currentTimeMillis () + 365 * 24 * 60 * 60 * 1000 );
213213
214214 Security .addProvider (new BouncyCastleProvider ());
215215 KeyPairGenerator keyPairGenerator = KeyPairGenerator .getInstance ("RSA" , "BC" );
216216 keyPairGenerator .initialize (1024 , new SecureRandom ());
217217 KeyPair keyPair = keyPairGenerator .generateKeyPair ();
218218
219- X500Principal dnName = new X500Principal ("CN=John Doe " );
219+ X500Principal dnName = new X500Principal ("CN=Apache CloudStack " );
220220 X509V1CertificateGenerator certGen = new X509V1CertificateGenerator ();
221221 certGen .setSerialNumber (BigInteger .valueOf (System .currentTimeMillis ()));
222222 certGen .setSubjectDN (dnName );
223- certGen .setIssuerDN (dnName ); // use the same
223+ certGen .setIssuerDN (dnName );
224224 certGen .setNotBefore (validityBeginDate );
225225 certGen .setNotAfter (validityEndDate );
226226 certGen .setPublicKey (keyPair .getPublic ());
0 commit comments