| ## sec_psm_gen_pub_key(3sec) Randomly generates a public key pair. This routine is not available in the DCE binary code. It is provided in DCE source for use by vendors. Synopsis #include <dce/sec_pk_base.h> error_status_t sec_psm_gen_pub_key( sec_pk_algorithm_id_t *key_type, unsigned32 modulus_bit_size, sec_pk_gen_data_t *seed, sec_pk_data_t *public_key, sec_pk_data_t *private_key, error_status_t *status); Parameters Input key_type A pointer to the object ID of the public key encryption algorithm to use. Only the RSA public key algorithm (RSA_PKCS) is currently supported. modulus_bit_size The desired length of the key. Interpretation of this parameter is dependent on the algorithm specified by key_type. For RSA, the only currently supported key type, modulus_bit_size is a number ranging from 256 through 1024 inclusive that specifies the bit length of the key modulus. A value of 0 indicates the default of 1024. seed A pointer to the string to seed the random key generator. Output private_key A pointer to a sec_pk_data_t that contains the private key structure of the newly generated key. public_key A pointer to a sec_pk_data_t that contains the public key structure of the newly generated key. status A pointer to the completion status. On successful completion, the routine returns error_status_ok. Otherwise, it returns an error. Description The sec_psm_gen_pub_key( ) routine generates a public key pair. This routine allocates memory for the returned key. Call the sec_pk_data_free( ) routine to deallocate the public key and sec_pk_data_zero_and_free( ) routine to deallocate the private key. Files /usr/include/dce/sec_pk_base.idl The idl file from which dce/sec_pk_base.h was derived. Errors The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages. error_status_ok sec_psm_wrong_pub_key_type sec_bsafe_alloc Related Information Functions: sec_psm_update_pub_key(3sec) sec_psm_put_pub_key(3sec) ##