pike.git / lib / modules / Standards.pmod / X509.pmod

version» Context lines:

pike.git/lib/modules/Standards.pmod/X509.pmod:285:      //! Represents a TBSCertificate.   //!   //! @note   //! Was not compatible with @[Standards.ASN1.Types.Sequence]   //! prior to Pike 8.0.   class TBSCertificate   {    inherit Sequence;    +  void _decode(array(int|array(Object)) x) +  { +  ::_decode(x); +  init(this); +  } +     protected string internal_der;       //!    void `der=(string asn1)    {    internal_der = UNDEFINED;    if (init(Standards.ASN1.Decode.simple_der_decode(asn1, x509_types))) {    internal_der = asn1;    }    }
pike.git/lib/modules/Standards.pmod/X509.pmod:752:    m->issuer = fmt_asn1(m->issuer);    m->subject = fmt_asn1(m->subject);    };    return sprintf("%O(%O)", this_program, m);    }       //! Populates the object from a certificate decoded into an ASN.1    //! Object. Returns the object on success, otherwise @expr{0@}. You    //! probably want to call @[decode_certificate] or even    //! @[verify_certificate]. -  this_program init(array(Object)|Object asn1) +  this_program init(array|Object asn1)    { -  array(Object) a; -  if (objectp(asn1)) { +  if (!objectp(asn1)) +  return 0; +     if (asn1->type_name != "SEQUENCE")    return 0;    -  a = ([object(Sequence)]asn1)->elements; -  } else { -  a = [array(Object)]asn1; -  } +  array(Object) a = ([object(Sequence)]asn1)->elements;    DBG("TBSCertificate: sizeof(a) = %d\n", sizeof(a));       if (sizeof(a) < 6)    return 0;       int version = 1;       if (sizeof(a) > 6)    {    /* The optional version field must be present */