}
  public byte[] getEncoded()  {    if (encodedKey != null)      return (byte[]) encodedKey.clone();    try      {        ByteArrayOutputStream out = new ByteArrayOutputStream();        ArrayList spki = new ArrayList(2);        ArrayList alg = new ArrayList(2);        alg.add(new DERValue(DER.OBJECT_IDENTIFIER,                new OID("1.2.840.113549.1.1.1")));        ArrayList params = new ArrayList(3);        params.add(new DERValue(DER.INTEGER, p));        params.add(new DERValue(DER.INTEGER, q));        params.add(new DERValue(DER.INTEGER, g));        alg.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, params));        spki.add(new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, alg));        spki.add(new DERValue(DER.BIT_STRING, new BitString(y.toByteArray())));        DERWriter.write(out, new DERValue(DER.CONSTRUCTED|DER.SEQUENCE, spki));        return (byte[]) (encodedKey = out.toByteArray()).clone();      }    catch (IOException ioe)      {    return null;  }  }