diff options
author | Bojan Suzic <bojan.suzic@iaik.tugraz.at> | 2014-02-04 13:35:09 +0100 |
---|---|---|
committer | Bojan Suzic <bojan.suzic@iaik.tugraz.at> | 2014-02-04 13:35:09 +0100 |
commit | 0a4c2f12ad6115ec40d325f5df8a3afb07d536dc (patch) | |
tree | f5ca85181fa6129bc1a42e918b5b64dd9cbdc744 /id/oa/src/main/java/at/gv | |
parent | 791615f1f887f81ade19a374e2552f3cb1be89ab (diff) | |
parent | 265a005d263ef99d57f53169cbd15b94d09046c8 (diff) | |
download | moa-id-spss-0a4c2f12ad6115ec40d325f5df8a3afb07d536dc.tar.gz moa-id-spss-0a4c2f12ad6115ec40d325f5df8a3afb07d536dc.tar.bz2 moa-id-spss-0a4c2f12ad6115ec40d325f5df8a3afb07d536dc.zip |
Merge branch 'moa2_0_tlenz' of gitlab.iaik.tugraz.at:afitzek/moa-idspss into moa2_0_tlenz_bs_2
Diffstat (limited to 'id/oa/src/main/java/at/gv')
-rw-r--r-- | id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/BuildMetadata.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/BuildMetadata.java b/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/BuildMetadata.java index 72a253694..652960bbc 100644 --- a/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/BuildMetadata.java +++ b/id/oa/src/main/java/at/gv/egovernment/moa/id/demoOA/servlet/pvp2/BuildMetadata.java @@ -48,6 +48,7 @@ import org.opensaml.common.xml.SAMLConstants; import org.opensaml.saml2.core.NameIDType; import org.opensaml.saml2.metadata.AssertionConsumerService; import org.opensaml.saml2.metadata.AttributeConsumingService; +import org.opensaml.saml2.metadata.EncryptionMethod; import org.opensaml.saml2.metadata.EntitiesDescriptor; import org.opensaml.saml2.metadata.EntityDescriptor; import org.opensaml.saml2.metadata.KeyDescriptor; @@ -55,6 +56,9 @@ import org.opensaml.saml2.metadata.LocalizedString; import org.opensaml.saml2.metadata.NameIDFormat; import org.opensaml.saml2.metadata.SPSSODescriptor; import org.opensaml.saml2.metadata.ServiceName; +import org.opensaml.saml2.metadata.impl.EncryptionMethodBuilder; +import org.opensaml.xml.encryption.EncryptionConstants; +import org.opensaml.xml.encryption.OAEPparams; import org.opensaml.xml.io.Marshaller; import org.opensaml.xml.security.credential.Credential; import org.opensaml.xml.security.credential.UsageType; @@ -170,8 +174,10 @@ public class BuildMetadata extends HttpServlet { config.getPVP2KeystoreAuthRequestKeyPassword().toCharArray()); KeyDescriptor signKeyDescriptor = SAML2Utils .createSAMLObject(KeyDescriptor.class); + signKeyDescriptor.setUse(UsageType.SIGNING); - signKeyDescriptor.setKeyInfo(keyInfoGenerator.generate(authcredential)); + signKeyDescriptor.setKeyInfo(keyInfoGenerator.generate(authcredential)); + spSSODescriptor.getKeyDescriptors().add(signKeyDescriptor); @@ -185,7 +191,17 @@ public class BuildMetadata extends HttpServlet { KeyDescriptor encryKeyDescriptor = SAML2Utils .createSAMLObject(KeyDescriptor.class); encryKeyDescriptor.setUse(UsageType.ENCRYPTION); - encryKeyDescriptor.setKeyInfo(keyInfoGenerator.generate(authEncCredential)); + encryKeyDescriptor.setKeyInfo(keyInfoGenerator.generate(authEncCredential)); + + //set encryption methode +// EncryptionMethod encMethode = SAML2Utils.createSAMLObject(EncryptionMethod.class); +// encMethode.setAlgorithm(EncryptionConstants.ALGO_ID_BLOCKCIPHER_AES128_GCM); +// encryKeyDescriptor.getEncryptionMethods().add(encMethode); +// +// EncryptionMethod keyencMethode = SAML2Utils.createSAMLObject(EncryptionMethod.class); +// keyencMethode.setAlgorithm(EncryptionConstants.ALGO_ID_KEYTRANSPORT_RSAOAEP); +// encryKeyDescriptor.getEncryptionMethods().add(keyencMethode); + spSSODescriptor.getKeyDescriptors().add(encryKeyDescriptor); } else { |