Really thanks by your answers, I could get recover the certificates 
in the user space with a empty selection control, now I will try to 
get the certificates with one 'filter' . 

Thanks,
 
--- Grace ---




________________________________
De: "c400-l-request@xxxxxxxxxxxx" <c400-l-request@xxxxxxxxxxxx>
Para: c400-l@xxxxxxxxxxxx
Enviado: jueves 30 de junio de 2011 13:00
Asunto: C400-L Digest, Vol 9, Issue 31

Send C400-L mailing list submissions to
    c400-l@xxxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.midrange.com/mailman/listinfo/c400-l
or, via email, send a message with subject or body 'help' to
    c400-l-request@xxxxxxxxxxxx

You can reach the person managing the list at
    c400-l-owner@xxxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of C400-L digest..."


Today's Topics:

  1. Selection Control getting user certificates (gn pr)
  2. Re: Selection Control getting user certificates (Barbara Morris)
  3. Re: Selection Control getting user certificates (Peter Connell)


----------------------------------------------------------------------

message: 1
date: Wed, 29 Jun 2011 23:02:24 +0100 (BST)
from: gn pr <gn_pr@xxxxxxxx>
subject: [C400-L] Selection Control getting user certificates

Hi,?

I have the next code, because I'm trying to get the user?
certificates , but I cannot recover the certificates?
of the user, I think it because the Selection Control is not in a good format.
Any help is?appreciated.
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?int main () { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? char *Qualified_user_space_name = "GRACE ? ? QGPL ? ? ?" ?; ?
? void *User_name = "GRACE ? ? " ; ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? char *Format_name = "CERT0200" ; ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? char *Selection_control = " ? 8 ? 0\0" ; ? ? ? ? ? ? ? ? ? ??
? char error_code[100]; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? QsyListUserCertificates ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? (Qualified_user_space_name, ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?User_name, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?Format_name, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?Selection_control, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?&error_code) ; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

?return 0 ;?
}
Thanks

------------------------------

message: 2
date: Wed, 29 Jun 2011 19:11:24 -0400
from: Barbara Morris <bmorris@xxxxxxxxxx>
subject: Re: [C400-L] Selection Control getting user certificates

On 6/29/2011 6:02 PM, gn pr wrote:

I have the next code, because I'm trying to get the user
certificates , but I cannot recover the certificates
of the user, I think it because the Selection Control is not in a good format.
Any help is appreciated.
...
    char *Selection_control = "  8  0\0" ;
...
    QsyListUserCertificates
            (Qualified_user_space_name,
            User_name,
            Format_name,
            Selection_control,
            &error_code) ;

Before you do anything else, set up your error_code parameter properly.
Currently, you are risking serious storage corruption by not
initializing it properly. Try this for a quick-and-dirty error code
parameter.

#include <qusec.h>
Qus_EC_t error_code = {0};

I think you will find it easier to use the Qsy_Sel_Ctrl_T and
Qsy_Sel_Ctrl_Pair_T typedefs rather than trying to build a string like
that. They are defined in <qsydigid.h> (QSYSINC/H member QSYDIGID).

If you know everything at code-writing time, you might be able to define
it like this, but this is just a guess from looking at the prototype and
structure definnitions; I am not familiar with this API.
    struct
    {
      Qsy_Sel_Ctrl_T sel_ctrl_header;
      Qsy_Sel_Ctrl_Pair_T pair1;
      char data1[whatever size you need for selection data 1];
      Qsy_Sel_Ctrl_Pair_T pair2;
      char data2[whatever size you need for selection data 2];
    etc
    } Selection_control;

Then add logic to set all the values in the Selection_control struct
according to the documentation.

If you don't know the size of the selection data until runtime, it would
be more complicated. You'd have to figure out the total length needed,
then allocate enough storage for the whole thing, then you'd use
pointers to the various structures, keeping track of your current offset
in the storage to know where to put the next piece of information.


------------------------------

message: 3
date: Thu, 30 Jun 2011 09:19:55 +1000
from: Peter Connell <Peter.Connell@xxxxxxxxxxxxxxxxx>
subject: Re: [C400-L] Selection Control getting user certificates

Hello gn pr,

I have not programmed the QsyListUserCertificates in C but I have used it in RPGLE.
The selection control parameter is pointer to a character structure.
I have it initialized with fixed values as per the following RPGLE spec

D SelectCtl      DS                         
D  Ctllen                      10I 0 Inz(8) 
D  Ctlpairs                    10I 0 Inz(0) 

It should work for you if pass it as a parameter containings two 4 byte binary numbers, the first binary number is assigned the length (8) and the second number set to zero.

Cheers, Peter

-----Original Message-----
From: c400-l-bounces+peter.connell=vedaadvantage.com@xxxxxxxxxxxx [mailto:c400-l-bounces+peter.connell=vedaadvantage.com@xxxxxxxxxxxx] On Behalf Of gn pr
Sent: Thursday, 30 June 2011 10:02 AM
To: c400-l@xxxxxxxxxxxx
Subject: [C400-L] Selection Control getting user certificates

Hi,?

I have the next code, because I'm trying to get the user?
certificates , but I cannot recover the certificates?
of the user, I think it because the Selection Control is not in a good format.
Any help is?appreciated.
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?int main () { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? char *Qualified_user_space_name = "GRACE ? ? QGPL ? ? ?" ?; ?
? void *User_name = "GRACE ? ? " ; ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? char *Format_name = "CERT0200" ; ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? char *Selection_control = " ? 8 ? 0\0" ; ? ? ? ? ? ? ? ? ? ??
? char error_code[100]; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? QsyListUserCertificates ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? (Qualified_user_space_name, ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?User_name, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?Format_name, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?Selection_control, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
? ? ? ? ? ?&error_code) ; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

?return 0 ;?
}
Thanks

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].