< prev index next >

src/java.security.jgss/share/classes/sun/security/krb5/internal/TicketFlags.java

Print this page




  34 import sun.security.krb5.internal.util.KerberosFlags;
  35 import sun.security.util.*;
  36 import java.io.IOException;
  37 
  38 /**
  39  * Implements the ASN.1TicketFlags type.
  40  *
  41  *    TicketFlags ::= BIT STRING
  42  *                  {
  43  *                   reserved(0),
  44  *                   forwardable(1),
  45  *                   forwarded(2),
  46  *                   proxiable(3),
  47  *                   proxy(4),
  48  *                   may-postdate(5),
  49  *                   postdated(6),
  50  *                   invalid(7),
  51  *                   renewable(8),
  52  *                   initial(9),
  53  *                   pre-authent(10),
  54  *                   hw-authent(11),
  55  *                   enc-pa-rep(15)
  56  *                  }
  57  */
  58 public class TicketFlags extends KerberosFlags {
  59     public TicketFlags() {
  60         super(Krb5.TKT_OPTS_MAX + 1);
  61     }
  62 
  63     public TicketFlags (boolean[] flags) throws Asn1Exception {
  64         super(flags);
  65         if (flags.length > Krb5.TKT_OPTS_MAX + 1) {
  66             throw new Asn1Exception(Krb5.BITSTRING_BAD_LENGTH);
  67         }
  68     }
  69 
  70     public TicketFlags(int size, byte[] data) throws Asn1Exception {
  71         super(size, data);
  72         if ((size > data.length * BITS_PER_UNIT) || (size > Krb5.TKT_OPTS_MAX + 1))
  73             throw new Asn1Exception(Krb5.BITSTRING_BAD_LENGTH);
  74     }
  75 


 161                 case 5:
 162                     sb.append("MAY-POSTDATE;");
 163                     break;
 164                 case 6:
 165                     sb.append("POSTDATED;");
 166                     break;
 167                 case 7:
 168                     sb.append("INVALID;");
 169                     break;
 170                 case 8:
 171                     sb.append("RENEWABLE;");
 172                     break;
 173                 case 9:
 174                     sb.append("INITIAL;");
 175                     break;
 176                 case 10:
 177                     sb.append("PRE-AUTHENT;");
 178                     break;
 179                 case 11:
 180                     sb.append("HW-AUTHENT;");
 181                     break;
 182                 case 15:
 183                     sb.append("ENC-PA-REP;");
 184                     break;
 185                 }
 186             }
 187         }
 188         String result = sb.toString();
 189         if (result.length() > 0) {
 190             result = result.substring(0, result.length() - 1);
 191         }
 192         return result;
 193     }
 194 }


  34 import sun.security.krb5.internal.util.KerberosFlags;
  35 import sun.security.util.*;
  36 import java.io.IOException;
  37 
  38 /**
  39  * Implements the ASN.1TicketFlags type.
  40  *
  41  *    TicketFlags ::= BIT STRING
  42  *                  {
  43  *                   reserved(0),
  44  *                   forwardable(1),
  45  *                   forwarded(2),
  46  *                   proxiable(3),
  47  *                   proxy(4),
  48  *                   may-postdate(5),
  49  *                   postdated(6),
  50  *                   invalid(7),
  51  *                   renewable(8),
  52  *                   initial(9),
  53  *                   pre-authent(10),
  54  *                   hw-authent(11)

  55  *                  }
  56  */
  57 public class TicketFlags extends KerberosFlags {
  58     public TicketFlags() {
  59         super(Krb5.TKT_OPTS_MAX + 1);
  60     }
  61 
  62     public TicketFlags (boolean[] flags) throws Asn1Exception {
  63         super(flags);
  64         if (flags.length > Krb5.TKT_OPTS_MAX + 1) {
  65             throw new Asn1Exception(Krb5.BITSTRING_BAD_LENGTH);
  66         }
  67     }
  68 
  69     public TicketFlags(int size, byte[] data) throws Asn1Exception {
  70         super(size, data);
  71         if ((size > data.length * BITS_PER_UNIT) || (size > Krb5.TKT_OPTS_MAX + 1))
  72             throw new Asn1Exception(Krb5.BITSTRING_BAD_LENGTH);
  73     }
  74 


 160                 case 5:
 161                     sb.append("MAY-POSTDATE;");
 162                     break;
 163                 case 6:
 164                     sb.append("POSTDATED;");
 165                     break;
 166                 case 7:
 167                     sb.append("INVALID;");
 168                     break;
 169                 case 8:
 170                     sb.append("RENEWABLE;");
 171                     break;
 172                 case 9:
 173                     sb.append("INITIAL;");
 174                     break;
 175                 case 10:
 176                     sb.append("PRE-AUTHENT;");
 177                     break;
 178                 case 11:
 179                     sb.append("HW-AUTHENT;");



 180                     break;
 181                 }
 182             }
 183         }
 184         String result = sb.toString();
 185         if (result.length() > 0) {
 186             result = result.substring(0, result.length() - 1);
 187         }
 188         return result;
 189     }
 190 }
< prev index next >