001package com.hfg.cert;
002
003import com.hfg.util.StringUtil;
004
005//------------------------------------------------------------------------------
006/**
007 * Container for a certificate Subject Alternative Name (SAN) entry.
008 *
009 * @author J. Alex Taylor, hairyfatguy.com
010 */
011//------------------------------------------------------------------------------
012// com.hfg XML/HTML Coding Library
013//
014// This library is free software; you can redistribute it and/or
015// modify it under the terms of the GNU Lesser General Public
016// License as published by the Free Software Foundation; either
017// version 2.1 of the License, or (at your option) any later version.
018//
019// This library is distributed in the hope that it will be useful,
020// but WITHOUT ANY WARRANTY; without even the implied warranty of
021// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
022// Lesser General Public License for more details.
023//
024// You should have received a copy of the GNU Lesser General Public
025// License along with this library; if not, write to the Free Software
026// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
027//
028// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com
029// jataylor@hairyfatguy.com
030//------------------------------------------------------------------------------
031
032public class SAN
033{
034   private SAN_Type mType;
035   private String   mValue;
036
037
038   //--------------------------------------------------------------------------
039   public SAN(SAN_Type inType, String inValue)
040   {
041      mType = inType;
042      mValue = inValue;
043   }
044
045
046   //--------------------------------------------------------------------------
047   @Override
048   public String toString()
049   {
050      return (StringUtil.isSet(mValue) ? mValue  + " " : "") + "[" + mType + "]" ;
051   }
052
053   //--------------------------------------------------------------------------
054   public SAN_Type getType()
055   {
056      return mType;
057   }
058
059   //--------------------------------------------------------------------------
060   public String getValue()
061   {
062      return mValue;
063   }
064}