private void writeObject(ObjectOutputStream stream) throws IOException {
    if (key.isEngineBased()) {
      throw new NotSerializableException("engine-based keys can not be serialized");
    }

    stream.defaultWriteObject();
    stream.writeObject(getEncoded());
  }
  @Override
  public BigInteger getS() {
    if (key.isEngineBased()) {
      throw new UnsupportedOperationException("private key value S cannot be extracted");
    }

    return getPrivateKey();
  }