< prev index next >

src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosPrincipal.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  62      */
  63     public static final int KRB_NT_SRV_INST =  2;
  64 
  65     /**
  66      * service with host name as instance (telnet, rcommands) name type.
  67      */
  68 
  69     public static final int KRB_NT_SRV_HST =   3;
  70 
  71     /**
  72      * service with host as remaining components name type.
  73      */
  74 
  75     public static final int KRB_NT_SRV_XHST =  4;
  76 
  77     /**
  78      * unique ID name type.
  79      */
  80 
  81     public static final int KRB_NT_UID = 5;
  82 
  83     /**
  84      * Enterprise name (alias)
  85      */
  86     public static final int KRB_NT_ENTERPRISE = 10;
  87 
  88     private transient String fullName;
  89 
  90     private transient String realm;
  91 
  92     private transient int nameType;
  93 
  94 
  95     /**
  96      * Constructs a {@code KerberosPrincipal} from the provided string input.
  97      * The name type for this principal defaults to
  98      * {@link #KRB_NT_PRINCIPAL KRB_NT_PRINCIPAL}
  99      * This string is assumed to contain a name in the format
 100      * that is specified in Section 2.1.1. (Kerberos Principal Name Form) of
 101      * <a href=http://www.ietf.org/rfc/rfc1964.txt> RFC 1964 </a>
 102      * (for example, <i>duke@FOO.COM</i>, where <i>duke</i>
 103      * represents a principal, and <i>FOO.COM</i> represents a realm).
 104      *
 105      * <p>If the input name does not contain a realm, the default realm
 106      * is used. The default realm can be specified either in a Kerberos


   1 /*
   2  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  62      */
  63     public static final int KRB_NT_SRV_INST =  2;
  64 
  65     /**
  66      * service with host name as instance (telnet, rcommands) name type.
  67      */
  68 
  69     public static final int KRB_NT_SRV_HST =   3;
  70 
  71     /**
  72      * service with host as remaining components name type.
  73      */
  74 
  75     public static final int KRB_NT_SRV_XHST =  4;
  76 
  77     /**
  78      * unique ID name type.
  79      */
  80 
  81     public static final int KRB_NT_UID = 5;





  82 
  83     private transient String fullName;
  84 
  85     private transient String realm;
  86 
  87     private transient int nameType;
  88 
  89 
  90     /**
  91      * Constructs a {@code KerberosPrincipal} from the provided string input.
  92      * The name type for this principal defaults to
  93      * {@link #KRB_NT_PRINCIPAL KRB_NT_PRINCIPAL}
  94      * This string is assumed to contain a name in the format
  95      * that is specified in Section 2.1.1. (Kerberos Principal Name Form) of
  96      * <a href=http://www.ietf.org/rfc/rfc1964.txt> RFC 1964 </a>
  97      * (for example, <i>duke@FOO.COM</i>, where <i>duke</i>
  98      * represents a principal, and <i>FOO.COM</i> represents a realm).
  99      *
 100      * <p>If the input name does not contain a realm, the default realm
 101      * is used. The default realm can be specified either in a Kerberos


< prev index next >