From: <go...@us...> - 2008-09-30 17:19:41
|
Revision: 3477 http://unicore.svn.sourceforge.net/unicore/?rev=3477&view=rev Author: golbi Date: 2008-09-30 17:19:15 +0000 (Tue, 30 Sep 2008) Log Message: ----------- added licenses and null checking method for priting cert subjects Modified Paths: -------------- securityFramework/securityLibrary/trunk/src/main/java/eu/unicore/security/CertificateUtils.java Added Paths: ----------- securityFramework/securityLibrary/trunk/LICENSE.txt securityFramework/xfire-secutils/trunk/LICENSE.txt securityFramework/xfire-secutilsWithDSig/trunk/LICENSE.txt Added: securityFramework/securityLibrary/trunk/LICENSE.txt =================================================================== --- securityFramework/securityLibrary/trunk/LICENSE.txt (rev 0) +++ securityFramework/securityLibrary/trunk/LICENSE.txt 2008-09-30 17:19:15 UTC (rev 3477) @@ -0,0 +1,23 @@ +Copyright (c) 2007-2009 ICM Uniwersytet Warszawski 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. Neither the name of the ICM Uniwersytet Warszawski nor +the names of its contributors may be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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. Modified: securityFramework/securityLibrary/trunk/src/main/java/eu/unicore/security/CertificateUtils.java =================================================================== --- securityFramework/securityLibrary/trunk/src/main/java/eu/unicore/security/CertificateUtils.java 2008-09-30 15:12:45 UTC (rev 3476) +++ securityFramework/securityLibrary/trunk/src/main/java/eu/unicore/security/CertificateUtils.java 2008-09-30 17:19:15 UTC (rev 3477) @@ -14,7 +14,7 @@ /** * Verifies if the certificate is not expired. In future CRL support - * should be added here. + * should be added here. Also additional certificate handling utils are provided. * <p> * This class is used internally by other APIs. Every certificate which is used * at any <b>validation</b> (e.g. check if ETD assertion is valid) is checked. @@ -47,5 +47,19 @@ verifyCertificate(cert, doCRLCheck, isGenerateMode); } - + public static String safePrintSubject(X509Certificate cert) + { + if (cert == null) + return "EMPTY certificate"; + if (cert.getSubjectX500Principal() == null) + return "certificate without a subject"; + return cert.getSubjectX500Principal().getName(); + } + + public static String safePrintSubject(X509Certificate[] cert) + { + if (cert == null || cert.length == 0) + return "EMPTY certificate"; + return safePrintSubject(cert[0]); + } } Added: securityFramework/xfire-secutils/trunk/LICENSE.txt =================================================================== --- securityFramework/xfire-secutils/trunk/LICENSE.txt (rev 0) +++ securityFramework/xfire-secutils/trunk/LICENSE.txt 2008-09-30 17:19:15 UTC (rev 3477) @@ -0,0 +1,23 @@ +Copyright (c) 2007-2009 ICM Uniwersytet Warszawski 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. Neither the name of the ICM Uniwersytet Warszawski nor +the names of its contributors may be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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. Added: securityFramework/xfire-secutilsWithDSig/trunk/LICENSE.txt =================================================================== --- securityFramework/xfire-secutilsWithDSig/trunk/LICENSE.txt (rev 0) +++ securityFramework/xfire-secutilsWithDSig/trunk/LICENSE.txt 2008-09-30 17:19:15 UTC (rev 3477) @@ -0,0 +1,23 @@ +Copyright (c) 2007-2009 ICM Uniwersytet Warszawski 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. Neither the name of the ICM Uniwersytet Warszawski nor +the names of its contributors may be used to endorse or promote products +derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 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. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |