Problem making shared library with openssl

2005-10-26 Thread Angel Martinez Gonzalez
Hello: I have a source files that use openssl functionality. I want to make a shared library to use this with Java. I did this following steps: 1º Compile sources: gcc -fPIC -g -c -Wall -I/usr/local/java/include \ -I/usr/local/java/include/linux \ -I/usr/local/ssl/include \

OpenSSL use into java applet

2005-09-13 Thread Angel Martinez Gonzalez
Hello: Sorry for my english. I have a native methods written in C that use openssl functions. This native methods are invoke into java applet throught JNI, but it don´t work. I think that my applet don´t find some .dll or .lib from OpenSSL, but I don´t know how do it. I use Microsoft Visual

Re: OpenSSL use into java applet

2005-09-13 Thread Angel Martinez Gonzalez
] To: openssl-users@openssl.org Sent: Tuesday, September 13, 2005 10:42 AM Subject: Re: OpenSSL use into java applet Angel Martinez Gonzalez wrote: Hello: Sorry for my english. I have a native methods written in C that use openssl functions. This native methods are invoke into java applet

Re: OpenSSL use into java applet

2005-09-13 Thread Angel Martinez Gonzalez
Hello: Well, I can use JNI and web applet when I signed this applet. I don´t have problem with JNI and web applet. The problem is when I use openssl functionsin my native code. IfI don´t use openssl it work fine. Iread some articles about the incompatibilityJNI and web-loaded applets, but

Get public key from a certificate

2005-08-29 Thread Angel Martinez Gonzalez
Hello: I have a certificate in char * format, and I want to get his public key. Are there an OpenSSL function to do this?. Thanks. __ OpenSSL Project http://www.openssl.org User Support Mailing

Get public key from X509 certificate

2005-07-22 Thread Angel Martinez Gonzalez
Hello: I want to get the RSA public key from a X509 certificate. Are there some function to do this?. I know this function: EVP_PKEY *509_get_pubkey(cert) But I want obtain a RSA *. Thanks __ OpenSSL Project

Strange error when I read a certificate

2005-07-22 Thread Angel Martinez Gonzalez
Hello: I want read a certificate, and I use the function PEM_read_X509. Then, I get the serial number and the subject name. I have done it with success reading a certain certificate, but when I read other certificate I have get a read error. And this certificate it´s ok. Both certificates are in

How initialize the PRNG using RAND_seed ?

2005-06-23 Thread Angel Martinez Gonzalez
Hello: I need initialize the PRNG to can generate keys and performing public key encryption. I want use one of this functions: void RAND_seed(const void *buf, int num); void RAND_add(const void *buf, int num, double entropy); But I don´t know what parameters I have to use. Somebody can

Re: How initialize the PRNG using RAND_seed ?

2005-06-23 Thread Angel Martinez Gonzalez
PROTECTED] To: openssl-users@openssl.org Sent: Thursday, June 23, 2005 10:17 AM Subject: Re: How initialize the PRNG using RAND_seed ? Angel Martinez Gonzalez wrote: Hello: I need initialize the PRNG to can generate keys and performing public key encryption. I want use one of this functions

Read a Bignum from file

2005-06-02 Thread Angel Martinez Gonzalez
Hello: I wrote a BIGNUM into a file using the function: int BN_print_fp(FILE *fp, const BIGNUM *a); But, How I can read this bignum from this file?. I don´t know a openssl function to read a bignum from a file. Thanks.

Get Serial number from a cert

2005-05-23 Thread Angel Martinez Gonzalez
Hello: I want to get the serial number from a certificate. I use this function: X509_get_serialNumber(). This function returns a ASN1_INTEGER struct, with the field length, type, data and flag. I suppose that the serial number is stored in the data field of the struct. But I can´t get it. My

Get an attribute from a certificate

2005-05-20 Thread Angel Martinez Gonzalez
Hello: I am newby with the certificates in OpenSSL. I want to get an attribute from a certificate, that I have stored in a local file .cer. What functions I have to use? Can somebody help me? Thanks. __ OpenSSL Project

Problem at RSA decrypt: block type is not 02

2005-05-16 Thread Angel Martinez Gonzalez
Hello: I want to cypher/decrypt messages with RSA. I use this functions to cypher and decypher: int CifradoClavePublica(RSA *claveRSA, char *texto, char **textocifrado) { int size = RSA_size(claveRSA); int blksize = size - 12; int length = strlen(texto); int blocks = length/blksize; int

Re: Problem at RSA decrypt: block type is not 02

2005-05-16 Thread Angel Martinez Gonzalez
the internal specifics of key selection and protocol. Eduardo On 2005-05-16 07:21:25 UTC, Angel Martinez Gonzalez wrote: I want to cypher/decrypt messages with RSA. I use this functions to cypher and decypher: int CifradoClavePublica(RSA *claveRSA, char *texto, char **textocifrado

How to cypher a struct with RSA_public_encrypt

2005-05-16 Thread Angel Martinez Gonzalez
Hello: I want to cypher a struct like this: struct { DES_cblock *key; int id; } Request; but, the RSA_public_encrypt function receive as parameter unsigned char *from, no a struct: int RSA_public_encrypt(int flen, unsigned char *from, unsigned char *to, RSA *rsa,

Re: No show errors with ERR_print_errors_fp()

2005-05-12 Thread Angel Martinez Gonzalez
Hello: I tried your advice but I obtain the same result. I have tried the following: ERR_load_crypto_strings(); printf (error: %i\n,ERR_get_error()); printf(ERR_error_string(ERR_get_error(), NULL)); printf(ERR_lib_error_string(ERR_get_error())); printf(ERR_func_error_string(ERR_get_error()));

Re: Loading RSA keys from file.

2005-05-11 Thread Angel Martinez Gonzalez
e, and 2- RSA_size() , this function generates a runtime error when encountered as well. I can't think of anything since I'm initializing my RSA object. Suggestions ? Angel Martinez Gonzalez [EMAIL PROTECTED] wrote: Hello Layla: Maybe, your error disapear if you will c

Re: Problem to cipher/decypher a struct with RSA

2005-05-11 Thread Angel Martinez Gonzalez
@openssl.org Sent: Thursday, May 12, 2005 9:51 AM Subject: Re: Problem to cipher/decypher a struct with RSA Angel Martinez Gonzalez wrote: Hello: I want to cypher/decypher an struct: struct PeticionSeudonimo { char *mensaje; int id_peticion; DES_cblock *clave_simetrica

No show errors with ERR_print_errors_fp()

2005-05-11 Thread Angel Martinez Gonzalez
Hello: I want to obtain the errors that I have, and I use the function ERR_print_errors_fp(). But , this give a empty file. And I have errors ... My code: ERR_load_crypto_strings(); fp = fopen(fileError, w); ERR_print_errors_fp(fp); fclose(fp); Can somebody help me? Thanks.

Re: Loading RSA keys from file.

2005-05-10 Thread Angel Martinez Gonzalez
Hello Layla: Maybe, your error disapear if you will change the following: apub = PEM_read_RSAPublicKey(f, NULL, NULL, NULL); Regards. - Original Message - From: Layla To: openssl-users@openssl.org Sent: Tuesday, May 10, 2005 9:30 AM Subject: Loading RSA keys

Problem to cipher/decypher a struct with RSA

2005-05-10 Thread Angel Martinez Gonzalez
Hello: I want to cypher/decypher an struct: struct PeticionSeudonimo { char *mensaje; int id_peticion; DES_cblock *clave_simetrica; }peticion_seudonimo; To do this, I first convert this struct to char *: char *ptrPeticionSeudonimo = (char *)peticion_seudonimo; Then I use this

Error using BN_rand_range() function

2005-04-28 Thread Angel Martinez Gonzalez
Hello: I want to generate a random number making use of BN_rand_range() function. But I obtain an error at execution time. This is my code: error = BN_rand_range(A, claveDSA_TTP-q); if (error == 1) printf (A obtenido correctamente\n); else printf (Error al obtener A\n); printf (A:

Re: Problem with BN_rand_range

2005-04-26 Thread Angel Martinez Gonzalez
@openssl.org Sent: Friday, April 22, 2005 9:52 PM Subject: Re: Problem with BN_rand_range Angel Martinez Gonzalez wrote: Hello: I want to generate a random number making use of BN_rand_range() function. But I obtain an error at execution time. This is my code: error = BN_rand_range

Problem with BN_rand_range

2005-04-22 Thread Angel Martinez Gonzalez
Hello: I want to generate a random number making use of BN_rand_range() function. But I obtain an error at execution time. This is my code: error = BN_rand_range(A, claveDSA_TTP-q); if (error == 1) printf (A obtenido correctamente\n); else printf (Error al obtener A\n); printf (A:

Re: Error with PEM_write_RSAPrivateKey function

2005-04-20 Thread Angel Martinez Gonzalez
: Tuesday, April 19, 2005 9:40 PM Subject: Re: Error with PEM_write_RSAPrivateKey function Angel Martinez Gonzalez wrote: Hello: I use this function to generate a RSA pair key and write the public and private key in a files. But this function have a error at execution time. what kind

Generate RSA key

2005-04-19 Thread Angel Martinez Gonzalez
Hello: I want to generate a RSA pair key. I do the following: RSA *claveRSA; int num = 1024; // Tamaño del módulo. unsigned long e = 3; // Exponente público RAND_screen(); claveRSA = RSA_new(); claveRSA = RSA_generate_key(num, e, NULL, NULL); But I obtain the same key allways. When I

Error with PEM_write_RSAPrivateKey function

2005-04-19 Thread Angel Martinez Gonzalez
Hello: I use this function to generate a RSA pair key and write the public and private key in a files. But this function have a error at execution time. I think that the problem is on the function: PEM_write_RSAPrivateKey(fp,key,NULL,NULL,0,NULL,NULL) But I don´t know what is wrong. The

Error to sign with OpenSSL

2005-04-13 Thread Angel Martinez Gonzalez
Hello: I want sign with OpenSSL, and I use the RSA_sign fuction: void Firmar(char *mdigest, int longmdigest, RSA *claveRSA) { int error; char *firma; firma = malloc(RSA_size(claveRSA)); error = RSA_sign(NID_sha1, mdigest, longmdigest, firma, strlen(firma), claveRSA); if (error == 1)

Generate symmetric key DES3

2005-04-12 Thread Angel Martinez Gonzalez
Hello: I want to generate a symmetric key with DES. But I don´t know very well, how do it. I tried the following: void GenerateKey() { DES_cblock *ret ; RAND_screen(); printf(Staus of PRNG: %i\n,RAND_status()); DES_random_key(ret); printf(key: %i\n,ret); } But I obtained an error

Request Setup error

2004-11-11 Thread Angel Martinez Gonzalez
Hello: I´m trying to initializate OpenCA. In Request Setup of Phase 1, I enter this DN: C=ES, ST=Valladolid, L=Boecillo, O=Telefonica I+D, OU=Casa Domotica, CN=domolinux.hi.inet/[EMAIL PROTECTED] obtained from this OpenSSL certificate: Certificate: Data: Version: 1 (0x0) Serial