Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 94930 invoked from network); 20 Dec 2006 17:24:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Dec 2006 17:24:56 -0000 Received: (qmail 73419 invoked by uid 500); 20 Dec 2006 17:25:03 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 73369 invoked by uid 500); 20 Dec 2006 17:25:03 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 73358 invoked by uid 99); 20 Dec 2006 17:25:03 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Dec 2006 09:25:03 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Dec 2006 09:24:55 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8FFC51A981A; Wed, 20 Dec 2006 09:24:06 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r489148 - in /directory/trunks/shared/ldap/src: main/java/org/apache/directory/shared/ldap/schema/syntax/ test/java/org/apache/directory/shared/ldap/schema/syntax/ Date: Wed, 20 Dec 2006 17:24:06 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061220172406.8FFC51A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: elecharny Date: Wed Dec 20 09:24:04 2006 New Revision: 489148 URL: http://svn.apache.org/viewvc?view=rev&rev=489148 Log: Added CertificatePair and CertificateList SyntaxChecker and tests Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxChecker.java directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxChecker.java directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxCheckerTest.java directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxCheckerTest.java Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxChecker.java URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxChecker.java?view=auto&rev=489148 ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxChecker.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxChecker.java Wed Dec 20 09:24:04 2006 @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.directory.shared.ldap.schema.syntax; + + +/** + * A SyntaxChecker which verifies that a value is a certificateList according to RFC 4523 : + * + * "Due to changes made to the definition of a CertificateList through time, + * no LDAP-specific encoding is defined for this syntax. Values of this + * syntax SHOULD be encoded using Distinguished Encoding Rules (DER) + * [X.690] and MUST only be transferred using the ;binary transfer + * option" + * + * It has been removed in RFC 4517 + * + * @author Apache Directory Project + * @version $Rev: 488616 $ + */ +public class CertificateListSyntaxChecker extends BinarySyntaxChecker +{ + /** the Apache assigned internal OID for this syntax checker */ + private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.9"; + + + /** + * Private default constructor to prevent unnecessary instantiation. + */ + public CertificateListSyntaxChecker() + { + super( SC_OID ); + } + + /** + * + * Creates a new instance of CertificateListSyntaxChecker. + * + * @param the oid to associate with this new SyntaxChecker + * + */ + protected CertificateListSyntaxChecker( String oid ) + { + super( oid ); + } + + /** + * @see org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker#isValidSyntax(Object) + */ + public boolean isValidSyntax( Object value ) + { + return true; + } +} Added: directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxChecker.java URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxChecker.java?view=auto&rev=489148 ============================================================================== --- directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxChecker.java (added) +++ directory/trunks/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxChecker.java Wed Dec 20 09:24:04 2006 @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.directory.shared.ldap.schema.syntax; + + +/** + * A SyntaxChecker which verifies that a value is a certificate pair according to RFC 4523 : + * + * "Due to changes made to the definition of a CertificatePair through time, + * no LDAP-specific encoding is defined for this syntax. Values of this + * syntax SHOULD be encoded using Distinguished Encoding Rules (DER) + * [X.690] and MUST only be transferred using the ;binary transfer + * option" + * + * It has been removed in RFC 4517 + * + * @author Apache Directory Project + * @version $Rev: 488616 $ + */ +public class CertificatePairSyntaxChecker extends BinarySyntaxChecker +{ + /** the Apache assigned internal OID for this syntax checker */ + private static final String SC_OID = "1.3.6.1.4.1.1466.115.121.1.10"; + + + /** + * Private default constructor to prevent unnecessary instantiation. + */ + public CertificatePairSyntaxChecker() + { + super( SC_OID ); + } + + /** + * + * Creates a new instance of CertificatePairSyntaxChecker. + * + * @param the oid to associate with this new SyntaxChecker + * + */ + protected CertificatePairSyntaxChecker( String oid ) + { + super( oid ); + } + + /** + * @see org.apache.directory.shared.ldap.schema.syntax.SyntaxChecker#isValidSyntax(Object) + */ + public boolean isValidSyntax( Object value ) + { + return true; + } +} Added: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxCheckerTest.java URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxCheckerTest.java?view=auto&rev=489148 ============================================================================== --- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxCheckerTest.java (added) +++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificateListSyntaxCheckerTest.java Wed Dec 20 09:24:04 2006 @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.directory.shared.ldap.schema.syntax; + +import junit.framework.TestCase; + +/** + * Test cases for CertificateListSyntaxChecker. + * + * @author Apache Directory Project + * @version $Rev$ + */ +public class CertificateListSyntaxCheckerTest extends TestCase +{ + CertificateListSyntaxChecker checker = new CertificateListSyntaxChecker(); + + + public void testNullString() + { + assertTrue( checker.isValidSyntax( null ) ); + } + + + public void testEmptyString() + { + assertTrue( checker.isValidSyntax( "" ) ); + } + + public void testOid() + { + assertEquals( "1.3.6.1.4.1.1466.115.121.1.9", checker.getSyntaxOid() ); + } + + public void testCorrectCase() + { + assertTrue( checker.isValidSyntax( "FALSE" ) ); + assertTrue( checker.isValidSyntax( new byte[]{0x01, (byte)0xFF} ) ); + } +} Added: directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxCheckerTest.java URL: http://svn.apache.org/viewvc/directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxCheckerTest.java?view=auto&rev=489148 ============================================================================== --- directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxCheckerTest.java (added) +++ directory/trunks/shared/ldap/src/test/java/org/apache/directory/shared/ldap/schema/syntax/CertificatePairSyntaxCheckerTest.java Wed Dec 20 09:24:04 2006 @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 org.apache.directory.shared.ldap.schema.syntax; + +import junit.framework.TestCase; + +/** + * Test cases for CertificatePairSyntaxChecker. + * + * @author Apache Directory Project + * @version $Rev$ + */ +public class CertificatePairSyntaxCheckerTest extends TestCase +{ + CertificatePairSyntaxChecker checker = new CertificatePairSyntaxChecker(); + + + public void testNullString() + { + assertTrue( checker.isValidSyntax( null ) ); + } + + + public void testEmptyString() + { + assertTrue( checker.isValidSyntax( "" ) ); + } + + public void testOid() + { + assertEquals( "1.3.6.1.4.1.1466.115.121.1.10", checker.getSyntaxOid() ); + } + + public void testCorrectCase() + { + assertTrue( checker.isValidSyntax( "FALSE" ) ); + assertTrue( checker.isValidSyntax( new byte[]{0x01, (byte)0xFF} ) ); + } +}