rem: myName = self.name; var windowReference=document.getElementById('certDetails'); windowReference.setAttribute("title","Certificate Detail: \""+myName+"\"");         
context: function setWindowName(){  myName = self.name;  var windowReference=document.getElementById('certDetails');  windowReference.setAttribute("title","Certificate Detail: \""+myName+"\"");  //  Get the token  //  XXX ignore this for now.  NSS will find the cert on a token  //      by "tokenname:certname", which is what we have.  //var tokenName = "";  //var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);  //var token = pk11db.findTokenByName(tokenName);  //  Get the cert from the cert database  var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);  //var cert = certdb.getCertByNickname(token, myName);  var cert = certdb.getCertByNickname(null, myName);  //  //  Set the cert attributes for viewing  //  //  The chain of trust  var chainEnum = cert.getChain();  chainEnum.first();  var c = 0;  var chain = [];  try {  while (true) {    var node = chainEnum.currentItem();    node = node.QueryInterface(nsIX509Cert);    chain[c++] = node.commonName;    chainEnum.next();  }  } catch (e) {}  AddCertChain("chain", chain.reverse());  //  Common Name  var cn=document.getElementById('commonname');  cn.setAttribute("value", cert.commonName);  //  Organization  var org=document.getElementById('organization');  org.setAttribute("value", cert.organization);  //  Organizational Unit  var ou=document.getElementById('orgunit');  ou.setAttribute("value", cert.organizationalUnit);  //  Subject Name  var subn=document.getElementById('subjectname');  subn.setAttribute("value", cert.subjectName);  //  Issuer Name  var issn=document.getElementById('issuername');  issn.setAttribute("value", cert.issuerName);  //  Serial Number  var sern=document.getElementById('serialnumber');  sern.setAttribute("value", cert.serialNumber);  //  RSA Public Modulus  var rsap=document.getElementById('rsapubmodulus');  rsap.setAttribute("value", cert.rsaPubModulus);  //  SHA1 Fingerprint  var sha1=document.getElementById('sha1fingerprint');  sha1.setAttribute("value", cert.sha1Fingerprint);  //  MD5 Fingerprint  var md5=document.getElementById('md5fingerprint');  md5.setAttribute("value", cert.md5Fingerprint);}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/639713ad8eb4f9cf12136e6b2155b56b1c58a21e/viewCertDetails.js/buggy/security/manager/pki/resources/content/viewCertDetails.js