GoLang openssl_pkey_new

request it (446)
GoLang replacement for PHP's openssl_pkey_new [edit | history]



Do you know a GoLang replacement for PHP's openssl_pkey_new? Write it!

PHP openssl_pkey_new

PHP original manual for openssl_pkey_new [ show | php.net ]

openssl_pkey_new

(PHP 4 >= 4.2.0, PHP 5, PHP 7)

openssl_pkey_newGenerates a new private key

Description

resource openssl_pkey_new ([ array $configargs ] )

openssl_pkey_new() generates a new private and public key pair. The public component of the key can be obtained using openssl_pkey_get_public().

Note: You need to have a valid openssl.cnf installed for this function to operate correctly. See the notes under the installation section for more information.

Parameters

configargs

You can finetune the key generation (such as specifying the number of bits) using configargs. See openssl_csr_new() for more information about configargs.

Return Values

Returns a resource identifier for the pkey on success, or FALSE on error.

Changelog

Version Description
7.1.0 The curve_name configarg was added to make it possible to create EC keys.