pike.git / lib / modules / Crypto.pmod / RSA.pmod

version» Context lines:

pike.git/lib/modules/Crypto.pmod/RSA.pmod:47:    //! the function @[r]. Default is @[random_string].    this_program set_random(function(int(0..):string(8bit)) r)    {    random = r;    return this;    }       //! Returns the string @expr{"RSA"@}.    string(8bit) name() { return "RSA"; }    +  //! Get the JWS algorithm identifier for a hash. +  //! +  //! @returns +  //! Returns @expr{0@} (zero) on failure. +  //! +  //! @seealso +  //! @rfc{7518:3.1@} +  string(7bit) jwa(.Hash hash); +     //    // --- Key methods    //       //! Can be initialized with a mapping with the elements n, e, d, p and    //! q.    protected void create(mapping(string(8bit):Gmp.mpz|int)|void params)    {    if(!params) return;    if( params->n && params->e )
pike.git/lib/modules/Crypto.pmod/RSA.pmod:616:    Sequence pkcs_public_key()    {    return PKCS_RSA->build_public_key(this);    }      #undef Sequence       //! Returns the string @expr{"RSA"@}.    string(8bit) name() { return "RSA"; }    +  //! Get the JWS algorithm identifier for a hash. +  //! +  //! @returns +  //! Returns @expr{0@} (zero) on failure. +  //! +  //! @seealso +  //! @rfc{7518:3.1@}    string(7bit) jwa(.Hash hash)    {    switch(hash->name()) {    case "sha256":    return "RS256";    case "sha384":    return "RS384";    case "sha512":    return "RS512";    }