Moved PK key writing from X509 module to PK module
This commit is contained in:
parent
1a7550ac67
commit
c7bb02be77
13 changed files with 575 additions and 445 deletions
|
@ -89,14 +89,14 @@ static int write_public_key( pk_context *key, const char *output_file )
|
|||
|
||||
if( opt.output_format == OUTPUT_FORMAT_PEM )
|
||||
{
|
||||
if( ( ret = x509write_pubkey_pem( key, output_buf, 16000 ) ) != 0 )
|
||||
if( ( ret = pk_write_pubkey_pem( key, output_buf, 16000 ) ) != 0 )
|
||||
return( ret );
|
||||
|
||||
len = strlen( (char *) output_buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ( ret = x509write_pubkey_der( key, output_buf, 16000 ) ) < 0 )
|
||||
if( ( ret = pk_write_pubkey_der( key, output_buf, 16000 ) ) < 0 )
|
||||
return( ret );
|
||||
|
||||
len = ret;
|
||||
|
@ -125,14 +125,14 @@ static int write_private_key( pk_context *key, const char *output_file )
|
|||
memset(output_buf, 0, 16000);
|
||||
if( opt.output_format == OUTPUT_FORMAT_PEM )
|
||||
{
|
||||
if( ( ret = x509write_key_pem( key, output_buf, 16000 ) ) != 0 )
|
||||
if( ( ret = pk_write_key_pem( key, output_buf, 16000 ) ) != 0 )
|
||||
return( ret );
|
||||
|
||||
len = strlen( (char *) output_buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ( ret = x509write_key_der( key, output_buf, 16000 ) ) < 0 )
|
||||
if( ( ret = pk_write_key_der( key, output_buf, 16000 ) ) < 0 )
|
||||
return( ret );
|
||||
|
||||
len = ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue