You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2014/08/28 19:58:51 UTC
[47/50] git commit: updated refs/heads/master to 97ed5ff
utils: fix static certificate value string in SAMLUtils
Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/5e7928bc
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/5e7928bc
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/5e7928bc
Branch: refs/heads/master
Commit: 5e7928bcb94be56fa3b9da68bc963d09bcace815
Parents: 0402f68
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Thu Aug 28 18:39:28 2014 +0200
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Thu Aug 28 19:45:27 2014 +0200
----------------------------------------------------------------------
utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5e7928bc/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
----------------------------------------------------------------------
diff --git a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
index a562d48..1f31dca 100644
--- a/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
+++ b/utils/src/org/apache/cloudstack/utils/auth/SAMLUtils.java
@@ -90,7 +90,7 @@ public class SAMLUtils {
public static final String SAML_NS = "saml://";
public static final String SAML_NAMEID = "SAML_NAMEID";
public static final String SAML_SESSION = "SAML_SESSION";
- public static final String CERTIFICATE_NAME = "SAMLSP_CERTIFICATE";
+ public static final String CERTIFICATE_NAME = "SAMLSP_X509CERTIFICATE";
public static String createSAMLId(String uid) {
return SAML_NS + uid;
@@ -207,20 +207,20 @@ public class SAMLUtils {
return (Response) unmarshaller.unmarshall(element);
}
- public static X509Certificate generateRandomX509Certification() throws NoSuchAlgorithmException, NoSuchProviderException, CertificateEncodingException, SignatureException, InvalidKeyException {
+ public static X509Certificate generateRandomX509Certificate() throws NoSuchAlgorithmException, NoSuchProviderException, CertificateEncodingException, SignatureException, InvalidKeyException {
Date validityBeginDate = new Date(System.currentTimeMillis() - 24 * 60 * 60 * 1000);
- Date validityEndDate = new Date(System.currentTimeMillis() + 2 * 365 * 24 * 60 * 60 * 1000);
+ Date validityEndDate = new Date(System.currentTimeMillis() + 365 * 24 * 60 * 60 * 1000);
Security.addProvider(new BouncyCastleProvider());
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA", "BC");
keyPairGenerator.initialize(1024, new SecureRandom());
KeyPair keyPair = keyPairGenerator.generateKeyPair();
- X500Principal dnName = new X500Principal("CN=John Doe");
+ X500Principal dnName = new X500Principal("CN=Apache CloudStack");
X509V1CertificateGenerator certGen = new X509V1CertificateGenerator();
certGen.setSerialNumber(BigInteger.valueOf(System.currentTimeMillis()));
certGen.setSubjectDN(dnName);
- certGen.setIssuerDN(dnName); // use the same
+ certGen.setIssuerDN(dnName);
certGen.setNotBefore(validityBeginDate);
certGen.setNotAfter(validityEndDate);
certGen.setPublicKey(keyPair.getPublic());