例: crossCertify method

次のエージェントは、aleblanc.id と cert2.id を相互認証します。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      Registration reg = session.createRegistration();
      reg.setRegistrationServer("AceOne");
      reg.setCertifierIDFile("d:¥¥NotesAdministrator¥¥cert2.id");
      DateTime dt = session.createDateTime("Today");
      dt.setNow();
      dt.adjustYear(1);
      reg.setExpiration(dt);
      if (reg.crossCertify("d:¥¥NotesAdministrator¥¥aleblanc.id", // ID file
        "AceHardware", // certifier password
        "")) // comment field
        { System.out.println("Recertification succeeded"); }
        else { System.out.println("Recertification failed"); }

    } catch(NotesException e) {
      System.out.println(e.id + " " + e.text);
      e.printStackTrace();
    }
  }
}