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