public String getNameString() {
   StringBuffer str = new StringBuffer();
   for (int i = 0; i < nameStrings.length; i++) {
     if (i > 0) str.append("/");
     str.append(nameStrings[i]);
   }
   return str.toString();
 }
 public String getSalt() {
   if (salt == null) {
     StringBuffer salt = new StringBuffer();
     salt.append(nameRealm.toString());
     for (int i = 0; i < nameStrings.length; i++) {
       salt.append(nameStrings[i]);
     }
     return salt.toString();
   }
   return salt;
 }
  /**
   * Initializes an EncTicketPart object.
   *
   * @param encoding a single DER-encoded value.
   * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
   * @exception IOException if an I/O error occurs while reading encoded data.
   * @exception RealmException if an error occurs while parsing a Realm object.
   */
  private static String getHexBytes(byte[] bytes, int len) throws IOException {

    StringBuffer sb = new StringBuffer();
    for (int i = 0; i < len; i++) {

      int b1 = (bytes[i] >> 4) & 0x0f;
      int b2 = bytes[i] & 0x0f;

      sb.append(Integer.toHexString(b1));
      sb.append(Integer.toHexString(b2));
      sb.append(' ');
    }
    return sb.toString();
  }
Beispiel #4
0
  public String toString() {
    String LINE_SEP = System.getProperty("line.separator");

    StringBuffer strbuf =
        new StringBuffer(
            "SunJCE Diffie-Hellman Public Key:"
                + LINE_SEP
                + "y:"
                + LINE_SEP
                + Debug.toHexString(this.y)
                + LINE_SEP
                + "p:"
                + LINE_SEP
                + Debug.toHexString(this.p)
                + LINE_SEP
                + "g:"
                + LINE_SEP
                + Debug.toHexString(this.g));
    if (this.l != 0) strbuf.append(LINE_SEP + "l:" + LINE_SEP + "    " + this.l);
    return strbuf.toString();
  }
Beispiel #5
0
 // return a string representation of this key for debugging
 public String toString() {
   StringBuffer sb = new StringBuffer();
   sb.append("Sun RSA private CRT key, ");
   sb.append(n.bitLength());
   sb.append(" bits\n  modulus:          ");
   sb.append(n);
   sb.append("\n  public exponent:  ");
   sb.append(e);
   sb.append("\n  private exponent: ");
   sb.append(d);
   sb.append("\n  prime p:          ");
   sb.append(p);
   sb.append("\n  prime q:          ");
   sb.append(q);
   sb.append("\n  prime exponent p: ");
   sb.append(pe);
   sb.append("\n  prime exponent q: ");
   sb.append(qe);
   sb.append("\n  crt coefficient:  ");
   sb.append(coeff);
   return sb.toString();
 }
 public String getPrincipalNameAsString() {
   StringBuffer temp = new StringBuffer(nameStrings[0]);
   for (int i = 1; i < nameStrings.length; i++) temp.append(nameStrings[i]);
   return temp.toString();
 }