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

version» Context lines:

pike.git/lib/modules/Tools.pmod/X509.pmod:1:   #pike __REAL_VERSION__   //#pragma strict_types      /* -  * $Id: X509.pmod,v 1.38 2004/09/06 18:05:07 grubba Exp $ +  * $Id$    *    * Some random functions for creating RFC-2459 style X.509 certificates.    *    */      constant dont_dump_module = 1;      #if constant(Standards.ASN1.Types.Sequence) && constant(Crypto.Hash)      import Standards.ASN1.Types;
pike.git/lib/modules/Tools.pmod/X509.pmod:156:    issuer,    validity,    subject,    keyinfo }) ));   }      //!   string make_selfsigned_dsa_certificate(Crypto.DSA dsa, int ttl, array name,    array|void extensions)   { -  Integer serial = Integer(1); /* Hard coded serial number */ +  Integer serial = +  Integer(Gmp.bignum(Standards.UUID.make_version1(-1)->encode(), 256));    int now = time();    Sequence validity = Sequence( ({ make_time(now), make_time(now + ttl) }) );       Sequence signature_algorithm = Sequence( ({ Identifiers.dsa_sha_id }) );       Sequence keyinfo = Sequence(    ({ /* Use an identifier with parameters */    DSA.algorithm_identifier(dsa),    BitString(DSA.public_key(dsa)) }) );   
pike.git/lib/modules/Tools.pmod/X509.pmod:200:   {    Sequence digest_info = Sequence( ({ Sequence( ({ digest_id, Null() }) ),    OctetString(digest) }) );    return rsa->raw_verify(digest_info->get_der(), Gmp.mpz(s, 256));   }      //!   string make_selfsigned_rsa_certificate(Crypto.RSA rsa, int ttl, array name,    array|void extensions)   { -  Integer serial = Integer(1); /* Hard coded serial number */ +  Integer serial = +  Integer(Gmp.bignum(Standards.UUID.make_version1(-1)->encode(), 256));       int now = time();    Sequence validity = Sequence( ({ make_time(now), make_time(now + ttl) }) );       Sequence signature_algorithm = Sequence( ({ Identifiers.rsa_sha1_id,    Null() }) );       Sequence keyinfo = Sequence(    ({ Sequence( ({ Identifiers.rsa_id, Null() }) ),    BitString(RSA.public_key(rsa)) }) );