gpg: import failure key xxxxxxxx: no valid user IDs

6,150

Solution 1

It might also be a version conflict: The key (originating from gpg v2.x) may have some feature old 1.4 series gpg doesn't understand.

(Similar, misleading error messages are given if you try to feed a pre-2.1 gpg with an elliptic curve key that you can create using gpg --expert in version 2.1 or newer.)

Solution 2

gpg requires a valid signature issued by the key owner - this is important because it binds the user description and e-mail address to the actual public key; otherwise, this information could be arbitrarily modified. This self-signature seems to be broken, thus gpg refuses to use the key.

Solution 3

gpg (GnuPG) 1.x.x only supports up to DAS1024. Any RSA key will however work.

The error "gpg: DSA requires the use of a 160 bit hash algorithm" will be thrown when trying to import a DSA2048 key where RSA2048 and even RSA4096 will work.


To check is public key is compliant with version 1.x:

> gpg --list-packet {key.pub}|grep -A2 "public sub key packet"

:public sub key packet:
        version 4, algo 1, created 1560364275, expires 0
        pkey[0]: [2048 bits]

Command will return Algo on first line where the 2 listed here can be selected with keys are generated (ref: Public-Key Algorithms).


ID Algorithm

== =========

1 - RSA (Encrypt or Sign) [HAC]

17 - DSA (Digital Signature Algorithm) [FIPS186] [HAC]


If algo 17 is returned, gpg (GnuPG) 1.x.x will only support up to 1024 bits (second line returned with the above command).

Please note that any Algorithm of any size are supported with gpg (GnuPG) 2.x.x

Share:
6,150
marc_s
Author by

marc_s

Updated on September 18, 2022

Comments

  • marc_s
    marc_s over 1 year

    I have this procedure, I want to be able to send or not the @sucursal parameter

    For example: if I run this, I should get all with values with parameter 9

    EXEC Fichada_por_sucursal '2018-05-01','2018-05-05','9'
    

    and if run this, I should get all the values no matter what

    EXEC Fichada_por_sucursal '2018-05-01','2018-05-05',''
    

    Stored procedure:

    ALTER PROCEDURE Fichada_por_sucursal 
        (@fecha1 DATE,
         @fecha2 DATE,
         @sucursal INT) 
    AS
        SELECT
            CASE DATENAME(dw, a.fecha )
               WHEN 'Monday' then 'Lunes'
               WHEN 'Tuesday ' then 'Martes'
               WHEN 'Wednesday ' then 'Miércoles'
               WHEN 'Thursday' then 'Jueves'
               WHEN 'Friday' then 'Viernes'
               WHEN 'Saturday' then 'Sábado'
               ELSE 'Domingo' 
            END AS Fechadia,
            a.legajo, c.nombres, e.abrv,
            CONVERT(CHAR(10), a.fecha, 103) AS Fecha,
            f.entrada AS Hora_IN,
            a.hora AS ENTRADA,
            f.salida AS Hora_out,
            b.hora AS SALIDA,
            DATEDIFF(HOUR, a.hora, b.hora) AS Horas_trabajadas,
            c.hor_x_jor Horas_jornada,
            DATEDIFF(HOUR, a.hora, b.hora) - hor_x_jor AS Diferencia
        FROM
            fichadas_in a, fichadas_out b, empleados c,
            sucursales d,Clasificacion e, grupo_horario f
        WHERE
            a.Legajo = b.Legajo
            AND a.fecha = b.fecha
            AND a.fecha BETWEEN @fecha1 AND @fecha2
            AND d.codigo = @sucursal
            AND a.legajo = c.legajo
            AND c.CCO = d.Codigo
            AND e.Codigo = c.Clasif
            AND c.grupo_h = f.codigo
        ORDER BY
            a.fecha,legajo
    

    Can I do that?

    • marc_s
      marc_s almost 6 years
      Bad habits to kick : using old-style JOINs - that old-style comma-separated list of tables style was replaced with the proper ANSI JOIN syntax in the ANSI-92 SQL Standard (more than 25 years ago) and its use is discouraged
  • kqr
    kqr over 6 years
    Not sure why you were downvoted. This was precisely my problem. The solution? Running the import with gpg2 instead of gpg made it much easier to import my ECC key into the new computer!
  • Admin
    Admin almost 6 years
    It doenst work, the parameter @sucursal come from a table where are not allowed nulls and there are not 0, o should i alter my table?
  • Admin
    Admin almost 6 years
    This Work pretty Fine, Thanks.
  • Fred
    Fred almost 6 years
    You're welcome but I would take note of Sean Lange other recommendations.
  • Admin
    Admin almost 6 years
    Im on it, Thanks
  • Admin
    Admin almost 6 years
    Im on it, Thanks.
  • Sean Lange
    Sean Lange almost 6 years
    Well what is in that table then? Is it a string that you are implicitly casting to an int? In that case your value would be 0 because there is no such thing as an empty string int.
  • Admin
    Admin almost 6 years
    Can i use The ISNULL Sentence with a Parameter using like? For example: @Parameter varchar (100) c.Nombres=IsNull(c.Nombres,'') like '%@parameter%' ??
  • marc_s
    marc_s almost 6 years
    Bad habits to kick : using old-style JOINs - that old-style comma-separated list of tables style was replaced with the proper ANSI JOIN syntax in the ANSI-92 SQL Standard (more than 25 years ago) and its use is discouraged