Re: error making Private RSA

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have solved my create public RSA problem with this code:
  printf( "Method 1\n" );
  RSA* RSA1 = RSA_new();
  RSA* RSA2 = RSA_new();

  RSA2->n = RSA1->n = My_RSA->n;
  RSA2->e = RSA1->e = My_RSA->e;
  RSA2->d = RSA1->d = My_RSA->d;
  RSA2->p = RSA1->p = My_RSA->p;
  RSA2->q = RSA1->q = My_RSA->q;

  RC = PEM_write_bio_RSAPublicKey( bio, RSA1 ) ;
  printf( "%d RC: %d\n", __LINE__, RC );

  RC = PEM_write_bio_RSAPrivateKey( bio, RSA2,
				    NULL, NULL, 0, NULL, NULL ) ;
  printf( "%d RC: %d\n", __LINE__, RC );

  if( !RSA1 )
    printf( RED
	    " ERROR: Could not load Public KEY!\n"
	    " PEM_read_bio_RSA_PUBKEY FAILED:\n %s\n" OFF,
	    ERR_error_string( ERR_get_error(), NULL ) ) ;

  else Check_Key( RSA1, ";" );

  if( !RSA2 )
    printf( RED
	    " ERROR: Could not load Private KEY!\n"
	    " PEM_read_bio_RSA_PUBKEY FAILED:\n %s\n" OFF,
	    ERR_error_string( ERR_get_error(), NULL ) ) ;

  else Check_Key( RSA2, ";" );




-- 
William Estrada
Mt Umunhum, CA, USA, Earth
HTTP:// Mt-Umunhum-Wireless.net
Skype: MrUmunhum

-- 
William Estrada
Mt Umunhum, CA, USA, Earth
HTTP:// Mt-Umunhum-Wireless.net
Skype: MrUmunhum



-- 
William Estrada
Mt Umunhum, CA, USA, Earth
HTTP:// Mt-Umunhum-Wireless.net
Skype: MrUmunhum

-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux