001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions Copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2006-2008 Sun Microsystems, Inc. 015 * Portions Copyright 2012-2016 ForgeRock AS. 016 */ 017package org.opends.server.schema; 018 019import static org.opends.server.schema.SchemaConstants.*; 020 021import org.forgerock.opendj.ldap.schema.Schema; 022import org.forgerock.opendj.ldap.schema.Syntax; 023import org.forgerock.opendj.server.config.server.AttributeSyntaxCfg; 024import org.opends.server.api.AttributeSyntax; 025 026 027/** 028 * This class implements the certificate pair attribute syntax. This should be 029 * restricted to holding only X.509 certificate pairs, but we will accept any 030 * set of bytes. It will be treated much like the octet string attribute 031 * syntax. 032 */ 033public class CertificatePairSyntax 034 extends AttributeSyntax<AttributeSyntaxCfg> 035{ 036 037 /** 038 * Creates a new instance of this syntax. Note that the only thing that 039 * should be done here is to invoke the default constructor for the 040 * superclass. All initialization should be performed in the 041 * <CODE>initializeSyntax</CODE> method. 042 */ 043 public CertificatePairSyntax() 044 { 045 super(); 046 } 047 048 /** {@inheritDoc} */ 049 @Override 050 public Syntax getSDKSyntax(Schema schema) 051 { 052 return schema.getSyntax(SchemaConstants.SYNTAX_CERTPAIR_OID); 053 } 054 055 /** 056 * Retrieves the common name for this attribute syntax. 057 * 058 * @return The common name for this attribute syntax. 059 */ 060 @Override 061 public String getName() 062 { 063 return SYNTAX_CERTPAIR_NAME; 064 } 065 066 /** 067 * Retrieves the OID for this attribute syntax. 068 * 069 * @return The OID for this attribute syntax. 070 */ 071 @Override 072 public String getOID() 073 { 074 return SYNTAX_CERTPAIR_OID; 075 } 076 077 /** 078 * Retrieves a description for this attribute syntax. 079 * 080 * @return A description for this attribute syntax. 081 */ 082 @Override 083 public String getDescription() 084 { 085 return SYNTAX_CERTPAIR_DESCRIPTION; 086 } 087} 088