code: function _getAttributesAsJson(attrs) {
    var rval = {};
    for(var i = 0; i < attrs.length; ++i) {
      var attr = attrs[i];
      if(attr.shortName && (
        attr.valueTagClass === asn1.Type.UTF8 ||
        attr.valueTagClass === asn1.Type.PRINTABLESTRING ||
        attr.valueTagClass === asn1.Type.IA5STRING)) {
        var value = attr.value;
        if(attr.valueTagClass === asn1.Type.UTF8) {
          value = forge.util.encodeUtf8(attr.value);
        }
        if(!(attr.shortName in rval)) {
          rval[attr.shortName] = value;
        } else if(forge.util.isArray(rval[attr.shortName])) {
          rval[attr.shortName].push(value);
        } else {
          rval[attr.shortName] = [rval[attr.shortName], value];
        }
      }
    }
    return rval;
  }
docs: Gets all printable attributes (typically of an issuer or subject) in a
  simplified JSON format for display.
  
  @param attrs the attributes.
  
  @return the JSON for display.