/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.aa.arp;
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/*
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
/*
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv;
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu>Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.aa.attrresolv;
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the
- * above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other
- * materials provided with the distribution, if any, must include the following acknowledgment: "This product includes
- * software developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu> Internet2
- * Project. Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2,
- * nor the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please
- * contact shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2,
- * UCAID, or the University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name,
- * without prior written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS
- * PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
- * NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS
- * WITH LICENSEE. IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED
- * INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
- * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.aap;
public class AAPTests extends TestCase {
public AAPTests(String name) {
+
super(name);
BasicConfigurator.resetConfiguration();
BasicConfigurator.configure();
}
public static void main(String[] args) {
+
junit.textui.TestRunner.run(AAPTests.class);
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.OFF);
}
protected void setUp() throws Exception {
+
super.setUp();
}
- public void testBasic() {
-
- try {
- AAP aap = new XMLAAP(new File("src/conf/AAP.xml").toURL().toString());
-
- assertFalse("anyAttribute was true",aap.anyAttribute());
-
- AttributeRule rule = aap.lookup("affiliation");
- assertNotNull("Unable to find rule", rule);
- assertTrue("Rule wasn't scoped",rule.getScoped());
- assertFalse("Rule was case-sensitive",rule.getCaseSensitive());
-
- SAMLAttribute a1 = new SAMLAttribute(new FileInputStream("data/attribute1.xml"));
- SAMLAttribute a2 = new SAMLAttribute((Element)a1.toDOM().cloneNode(true));
-
- rule = aap.lookup(a1.getName(),a1.getNamespace());
- assertNotNull("Unable to find rule", rule);
-
- rule.apply(a1, null);
- try {
- a1.checkValidity();
- assertTrue("Attribute should have been stripped clean",false);
- }
- catch (SAMLException ex) {
- }
-
- Metadata metadata = new XMLMetadata(new File("src/conf/IQ-sites.xml").toURL().toString());
- rule.apply(a2, metadata.lookup("urn:mace:inqueue:example.edu").getAttributeAuthorityDescriptor(XML.SAML11_PROTOCOL_ENUM));
- a2.checkValidity();
- assertTrue("Value was unexpected","member".equalsIgnoreCase((String)a2.getValues().next()));
-
- } catch (Exception e) {
- fail("Failed to correctly load AAP: " + e);
- }
- }
+ public void testBasic() {
+
+ try {
+ AAP aap = new XMLAAP(new File("src/conf/AAP.xml").toURL().toString());
+
+ assertFalse("anyAttribute was true", aap.anyAttribute());
+
+ AttributeRule rule = aap.lookup("affiliation");
+ assertNotNull("Unable to find rule", rule);
+ assertTrue("Rule wasn't scoped", rule.getScoped());
+ assertFalse("Rule was case-sensitive", rule.getCaseSensitive());
+
+ SAMLAttribute a1 = new SAMLAttribute(new FileInputStream("data/attribute1.xml"));
+ SAMLAttribute a2 = new SAMLAttribute((Element) a1.toDOM().cloneNode(true));
+
+ rule = aap.lookup(a1.getName(), a1.getNamespace());
+ assertNotNull("Unable to find rule", rule);
+
+ rule.apply(a1, null);
+ try {
+ a1.checkValidity();
+ assertTrue("Attribute should have been stripped clean", false);
+ } catch (SAMLException ex) {}
+
+ Metadata metadata = new XMLMetadata(new File("src/conf/IQ-sites.xml").toURL().toString());
+ rule.apply(a2, metadata.lookup("urn:mace:inqueue:example.edu").getAttributeAuthorityDescriptor(
+ XML.SAML11_PROTOCOL_ENUM));
+ a2.checkValidity();
+ assertTrue("Value was unexpected", "member".equalsIgnoreCase((String) a2.getValues().next()));
+
+ } catch (Exception e) {
+ fail("Failed to correctly load AAP: " + e);
+ }
+ }
}
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved
- *
- *
- * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
- * following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
- * disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the distribution, if any, must include the
- * following acknowledgment: "This product includes software developed by the University Corporation for Advanced
- * Internet Development <http://www.ucaid.edu> Internet2 Project. Alternately, this acknowledegement may appear in the
- * software itself, if and wherever such third-party acknowledgments normally appear.
- *
- * Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor the University Corporation for
- * Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote products derived from this software
- * without specific prior written permission. For written permission, please contact shibboleth@shibboleth.org
- *
- * Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the University Corporation
- * for Advanced Internet Development, nor may Shibboleth appear in their name, without prior written permission of the
- * University Corporation for Advanced Internet Development.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE,
- * ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY
- * CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.common;
private Parser.DOMParser parser = new Parser.DOMParser(true);
public CredentialsTests(String name) {
+
super(name);
BasicConfigurator.resetConfiguration();
BasicConfigurator.configure();
}
public static void main(String[] args) {
+
junit.textui.TestRunner.run(CredentialsTests.class);
BasicConfigurator.configure();
Logger.getRootLogger().setLevel(Level.OFF);
* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
+
super.setUp();
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[1].getSubjectDN().getName(),
- "CN=HEPKI Server CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[1].getSubjectDN().getName(),
+ "CN=HEPKI Server CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(1));
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(1));
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(2));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[1].getSubjectDN().getName(),
- "CN=HEPKI Server CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(2));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[1].getSubjectDN().getName(),
+ "CN=HEPKI Server CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
}
-
+
public void testFileX509RSANoCert() {
try {
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.hasX509Certificate(),
- false);
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(0));
+ assertEquals("Unexpected X509 certificate found.", credential.hasX509Certificate(), false);
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(0));
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.DSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.DSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=test.columbia.edu, OU=ACIS, O=Columbia University, L=New York, ST=NY, C=US");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(1));
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=test.columbia.edu, OU=ACIS, O=Columbia University, L=New York, ST=NY, C=US");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(1));
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.DSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.DSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=test.columbia.edu, OU=ACIS, O=Columbia University, L=New York, ST=NY, C=US");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(1));
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=test.columbia.edu, OU=ACIS, O=Columbia University, L=New York, ST=NY, C=US");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(1));
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.DSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.DSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=test.columbia.edu, OU=ACIS, O=Columbia University, L=New York, ST=NY, C=US");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(1));
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=test.columbia.edu, OU=ACIS, O=Columbia University, L=New York, ST=NY, C=US");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(1));
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.RSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.RSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(3));
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509CertificateChain()[2].getSubjectDN().getName(),
- "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=shib2.internet2.edu, OU=Unknown, O=Unknown, ST=Unknown, C=Unknown");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(3));
+ assertEquals(
+ "Unexpected X509 certificate found.",
+ credential.getX509CertificateChain()[2].getSubjectDN().getName(),
+ "CN=HEPKI Master CA -- 20020701A, OU=Division of Information Technology, O=University of Wisconsin, L=Madison, ST=Wisconsin, C=US");
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
assertTrue("Credential could not be found.", credentials.containsCredential("test"));
Credential credential = credentials.getCredential("test");
- assertTrue(
- "Credential was loaded with an incorrect type.",
- credential.getCredentialType() == Credential.DSA);
+ assertTrue("Credential was loaded with an incorrect type.",
+ credential.getCredentialType() == Credential.DSA);
assertNotNull("Private key was not loaded correctly.", credential.getPrivateKey());
- assertEquals(
- "Unexpected X509 certificate found.",
- credential.getX509Certificate().getSubjectDN().getName(),
- "CN=test.columbia.edu, OU=ACIS, O=Columbia University, L=New York, ST=NY, C=US");
- assertEquals(
- "Unexpected certificate chain length.",
- new Integer(credential.getX509CertificateChain().length),
- new Integer(1));
+ assertEquals("Unexpected X509 certificate found.",
+ credential.getX509Certificate().getSubjectDN().getName(),
+ "CN=test.columbia.edu, OU=ACIS, O=Columbia University, L=New York, ST=NY, C=US");
+ assertEquals("Unexpected certificate chain length.", new Integer(
+ credential.getX509CertificateChain().length), new Integer(1));
} catch (Exception e) {
fail("Failed to load credentials: " + e);
}
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu> Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.common;
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu> Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.common.provider;
parser.parse(new InputSource(new StringReader(rawConfig)));
nameMapper.addNameMapping(parser.getDocument().getDocumentElement());
- SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("cryptotest", new LocalPrincipal(
- "testprincipal"), new BasicServiceProvider(), new BasicIdentityProvider("urn-x:testid"));
+ SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("cryptotest", new LocalPrincipal("testprincipal"),
+ new BasicServiceProvider(), new BasicIdentityProvider("urn-x:testid"));
Principal principal = nameMapper.getPrincipal(nameId, new BasicServiceProvider(),
new BasicIdentityProvider("urn-x:testid"));
parser.parse(new InputSource(new StringReader(rawConfig)));
nameMapper.addNameMapping(parser.getDocument().getDocumentElement());
- SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("cryptotest", new LocalPrincipal(
- "testprincipal"), new BasicServiceProvider(), new BasicIdentityProvider("urn-x:testid"));
+ SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("cryptotest", new LocalPrincipal("testprincipal"),
+ new BasicServiceProvider(), new BasicIdentityProvider("urn-x:testid"));
log.debug("Waiting 11 seconds for the handle to expire.");
Thread.sleep(11000);
parser.parse(new InputSource(new StringReader(rawConfig)));
nameMapper.addNameMapping(parser.getDocument().getDocumentElement());
- SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("cryptotest", new LocalPrincipal(
- "testprincipal"), new BasicServiceProvider(), new BasicIdentityProvider("urn-x:testid"));
+ SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("cryptotest", new LocalPrincipal("testprincipal"),
+ new BasicServiceProvider(), new BasicIdentityProvider("urn-x:testid"));
Principal principal = nameMapper.getPrincipal(nameId, new BasicServiceProvider(),
new BasicIdentityProvider("urn-x:testid"));
parser.parse(new InputSource(new StringReader(rawConfig)));
nameMapper.addNameMapping(parser.getDocument().getDocumentElement());
- SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("cryptotest", new LocalPrincipal(
- "testprincipal"), new BasicServiceProvider(), new BasicIdentityProvider("urn-x:good"));
+ SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("cryptotest", new LocalPrincipal("testprincipal"),
+ new BasicServiceProvider(), new BasicIdentityProvider("urn-x:good"));
Principal principal = nameMapper.getPrincipal(nameId, new BasicServiceProvider(),
new BasicIdentityProvider("urn-x:bad"));
parser.parse(new InputSource(new StringReader(rawConfig)));
nameMapper.addNameMapping(parser.getDocument().getDocumentElement());
- SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("memorytest", new LocalPrincipal(
- "testprincipal"), new BasicServiceProvider(), new BasicIdentityProvider("urn-x:testid"));
+ SAMLNameIdentifier nameId = nameMapper.getNameIdentifier("memorytest", new LocalPrincipal("testprincipal"),
+ new BasicServiceProvider(), new BasicIdentityProvider("urn-x:testid"));
Principal principal = nameMapper.getPrincipal(nameId, new BasicServiceProvider(),
new BasicIdentityProvider("urn-x:testid"));
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu> Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.idp.provider;
keyStore.load(new ShibResource(new File("data/cnextract.jks").toURL().toString()).getInputStream(),
new char[]{'t', 'e', 's', 't', '1', '2', '3'});
X509Certificate cert = (X509Certificate) keyStore.getCertificate("scott");
-
+
FileOutputStream output = new FileOutputStream("/tmp/principal.der");
output.write(cert.getSubjectX500Principal().getEncoded());
output.close();
-
+
assertEquals("Round-trip handle validation failed on DN.", BaseHandler.getHostNameFromDN(cert
.getSubjectX500Principal()), "asd3.ais.ucla.edu");
/*
- * The Shibboleth License, Version 1. Copyright (c) 2002 University Corporation for Advanced Internet Development, Inc.
- * All rights reserved Redistribution and use in source and binary forms, with or without modification, are permitted
- * provided that the following conditions are met: Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution, if any, must include the following acknowledgment: "This product includes software
- * developed by the University Corporation for Advanced Internet Development <http://www.ucaid.edu> Internet2 Project.
- * Alternately, this acknowledegement may appear in the software itself, if and wherever such third-party
- * acknowledgments normally appear. Neither the name of Shibboleth nor the names of its contributors, nor Internet2, nor
- * the University Corporation for Advanced Internet Development, Inc., nor UCAID may be used to endorse or promote
- * products derived from this software without specific prior written permission. For written permission, please contact
- * shibboleth@shibboleth.org Products derived from this software may not be called Shibboleth, Internet2, UCAID, or the
- * University Corporation for Advanced Internet Development, nor may Shibboleth appear in their name, without prior
- * written permission of the University Corporation for Advanced Internet Development. THIS SOFTWARE IS PROVIDED BY THE
- * COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND WITH ALL FAULTS. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE
- * DISCLAIMED AND THE ENTIRE RISK OF SATISFACTORY QUALITY, PERFORMANCE, ACCURACY, AND EFFORT IS WITH LICENSEE. IN NO
- * EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY CORPORATION FOR ADVANCED INTERNET DEVELOPMENT, INC.
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * Copyright [2005] [University Corporation for Advanced Internet Development, Inc.]
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package edu.internet2.middleware.shibboleth.metadata;
}
}
- public void testExtensionSAMLXML() {
+ public void testExtensionSAMLXML() {
- try {
- Metadata metadata = new XMLMetadata(new File("data/metadata10.xml").toURL().toString());
+ try {
+ Metadata metadata = new XMLMetadata(new File("data/metadata10.xml").toURL().toString());
+
+ EntityDescriptor entity = metadata.lookup("urn-x:testSP1");
+ assertNotNull("Unable to find test provider", entity);
- EntityDescriptor entity = metadata.lookup("urn-x:testSP1");
- assertNotNull("Unable to find test provider", entity);
+ AttributeRequesterDescriptor ar = entity.getAttributeRequesterDescriptor(XML.SAML11_PROTOCOL_ENUM);
+ assertNotNull("Missing AR provider role.", ar);
- AttributeRequesterDescriptor ar = entity.getAttributeRequesterDescriptor(XML.SAML11_PROTOCOL_ENUM);
- assertNotNull("Missing AR provider role.", ar);
-
- Iterator formats = ar.getNameIDFormats();
- assertTrue("Encountered unexpected NameIDFormat", formats.hasNext() && Constants.SHIB_NAMEID_FORMAT_URI.equals(formats.next()));
- } catch (Exception e) {
- fail("Failed to correctly load metadata: " + e);
- }
- }
+ Iterator formats = ar.getNameIDFormats();
+ assertTrue("Encountered unexpected NameIDFormat", formats.hasNext()
+ && Constants.SHIB_NAMEID_FORMAT_URI.equals(formats.next()));
+ } catch (Exception e) {
+ fail("Failed to correctly load metadata: " + e);
+ }
+ }
}