Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4426033

Should add an X500Principal(InputStream) constructor

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.4.0
    • security-libs
    • None
    • beta2
    • generic
    • generic


      sean.mullan@ireland 2001-03-15

      It would be very useful to add an X500Principal(InputStream) constructor
      which reads an ASN.1 DER encoded X500Name from the InputStream and leaves
      the pointer at the next available byte in the InputStream. More often than not,
      a user will be reading the contents of an X.509Certificate from an
      InputStream - having a constructor that reads the X500Name from anywhere
      in the stream is very useful.

      Here's the proposed javadoc:

          /**
           * Creates an <code>X500Principal</code> from an <code>InputStream</code>
           * containing the distinguished name in ASN.1 DER encoded form. The read
           * position of the input stream is positioned to the next available byte
           * after the encoded distinguished name.
           *
           * @param inStream an <code>InputStream</code> containing the distinguished
           * name in ASN.1 DER encoded form
           * @throws IOException if an encoding error occurs (incorrect form for DN)
           */
          public X500Principal(InputStream inStream) throws IOException

      Also, I think the InputStream needs to support mark() so that the stream
      can be reset() if there are errors.

            claisunw Charlie Lai (Inactive)
            mullan Sean Mullan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: