code: @Override
      public byte[] getEncoded(String encoding)
              throws CertificateEncodingException {
          switch (encoding) {
              case PKIPATH_ENCODING:
                  return encodePKIPATH();
              case PKCS7_ENCODING:
                  return encodePKCS7();
              default:
                  throw new CertificateEncodingException("unsupported encoding");
          }
      }
docs: Returns the encoded form of this certification path, using the
  specified encoding.
  
  @param encoding the name of the encoding to use
  @return the encoded bytes
  @exception CertificateEncodingException if an encoding error occurs or
  the encoding requested is not supported