fixing generation of keys
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package no.steras.opensamlbook.idp;
|
||||
|
||||
import org.opensaml.security.credential.Credential;
|
||||
import org.opensaml.security.credential.CredentialSupport;
|
||||
import org.opensaml.security.crypto.KeySupport;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -16,7 +18,7 @@ import java.util.Map;
|
||||
* Created by Privat on 13/05/14.
|
||||
*/
|
||||
public class IDPCredentials {
|
||||
/* private static final Credential credential;
|
||||
private static final Credential credential;
|
||||
|
||||
static {
|
||||
credential = generateCredential();
|
||||
@@ -25,8 +27,8 @@ public class IDPCredentials {
|
||||
private static Credential generateCredential() {
|
||||
try {
|
||||
//KeySupport
|
||||
KeyPair keyPair = SecurityHelper.generateKeyPair("RSA", 1024, null);
|
||||
return SecurityHelper.getSimpleCredential(keyPair.getPublic(), keyPair.getPrivate());
|
||||
KeyPair keyPair = KeySupport.generateKeyPair("RSA", 1024, null);
|
||||
return CredentialSupport.getSimpleCredential(keyPair.getPublic(), keyPair.getPrivate());
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (NoSuchProviderException e) {
|
||||
@@ -37,5 +39,5 @@ public class IDPCredentials {
|
||||
public static Credential getCredential() {
|
||||
return credential;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user