public void testAddCertificate2() throws Exception {
  Identity i=new IdentityStub("iii");
  PublicKeyStub pk1=new PublicKeyStub("kkk","fff",null);
  CertificateStub c1=new CertificateStub("fff",null,null,pk1);
  i.addCertificate(c1);
  assertSame(c1,i.certificates()[0]);
  assertSame(pk1,i.getPublicKey());
}

public void testAddCertificate2 ( ) throws Exception { Identity i = new IdentityStub ( "iii" ) ; PublicKeyStub pk1 = new PublicKeyStub ( "kkk" , "fff" , null ) ; CertificateStub c1 = new CertificateStub ( "fff" , null , null , pk1 ) ; i . addCertificate ( c1 ) ; assertSame ( c1 , i . certificates ( ) [ 0 ] ) ; assertSame ( pk1 , i . getPublicKey ( ) ) ; }
verify addcertificate ( certificate certificate ) adds a certificate for this identity . if the identity does not have a public key , the identity ' s public key is set to be that specified in the certificate .
