PreviousNext

sec_psm_encrypt_data(3sec)

Encrypts data using a public key mechanism. 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_encrypt_data(

sec_psm_handle_t psm_handle,

sec_pk domain_t *encryptee_domain,

void *encryptee_name,

unsigned32 *kvno,

sec_pk_algorithm_id_t *encryption_alg_id,

sec_pk_usage_flags_t key_usage,

sec_pk_gen_data_t *clear_data,

sec_pk_encrypted_t **cipher_data,

error_status_t *status);

Parameters

Input

psm_handle
A pointer to an opaque handle to the personal security context data. Use sec_psm_open( ) to obtain the handle.

encryptee_domain
A pointer to the application domain of the principal for which the data is encrypted.

encryptee_name
A pointer to the name of the principal for which the data is encrypted.

encryption_alg_id
The ASN.1 DER-encoded object ID of the encryption algorithm to use, such as RSA.

key_usage
A sec_pk_usage_flags_t that contains the usage flag for the public key specified by data.

clear_data
A pointer to ASN.1 DER-encoded data to be encrypted.

Input/Output

kvno
As input, the unsigned 32-bit version number of the key with which to encrypt the data. As output, the unsigned 32-bit version number of the key used to encrypt the data.

Output

cipher_data
A pointer to the encrypted data.

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_encrypt_data( ) routine encrypts data by using a public key encryption mechanism. The encryption_alg_id parameter specifies the encryption algorithm. This routine allocates memory for cipher_data. Call thesec_pk_data_free( ) routine to deallocate that memory.

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_not_init

sec_psm_invalid_handle

sec_psm_unsupported_algorithm_id

sec_pk_e_domain_unsupported

sec_pk_e_usage_unsupported

sec_rgy_object_not_found

sec_rgy_not_authorized

sec_attr_unsupported

Related Information

Functions:
sec_pk_data_free(3sec)
sec_psm_decrypt_data(3sec)