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

version» Context lines:

pike.git/lib/modules/Standards.pmod/X509.pmod:252:      class Verifier {    constant type = "none";    int(0..1) verify(object,string,string);    optional Crypto.RSA rsa;    optional Crypto.DSA dsa;       extern protected int(0..1) pkcs_verify(string, Crypto.Hash, string);       //! Verifies the @[signature] of the certificate @[msg] using the -  //! indicated hash @[algorithm]. The signature is the DER-encoded -  //! ASN.1 sequence Dss-Sig-Value with the two integers r and s. See -  //! RFC 3279 section 2.2.2. +  //! indicated hash @[algorithm].    int(0..1) verify(Sequence algorithm, string msg, string signature)    {    Crypto.Hash hash = algorithms[algorithm[0]->get_der()];    if (!hash) return 0;    return pkcs_verify(msg, hash, signature);    }   }      protected class RSAVerifier   {
pike.git/lib/modules/Standards.pmod/X509.pmod:292:    inherit Verifier;    Crypto.DSA dsa;       constant type = "dsa";       protected void create(string key, Gmp.mpz p, Gmp.mpz q, Gmp.mpz g)    {    dsa = DSA.parse_public_key(key, p, q, g);    }    +  // The signature is the DER-encoded ASN.1 sequence Dss-Sig-Value +  // with the two integers r and s. See RFC 3279 section 2.2.2.    protected int(0..1) pkcs_verify(string msg, Crypto.Hash h, string sign)    {    return dsa && dsa->pkcs_verify(msg, h, sign);    }   }      protected Verifier make_verifier(Object _keyinfo)   {    if( _keyinfo->type_name != "SEQUENCE" )    return 0;