Chapter 2 Algorithm Info Types 47
AI_DHKeyAgreeBER
AI_DHKeyAgreeBER
Purpose:
This AI is similar to AI_DHKeyAgree except that it uses the ASN.1 BER format. This AI
allows you to parse and create ASN.1 algorithm identifiers such as used in PKCS #7
and other protocols. You call B_SetAlgorithmInfo to initialize an algorithm object
from the encoded algorithm identifier that includes the prime modulus, base, and
private value length. Alternatively, you call B_GetAlgorithmInfo with this AI to
create an encoded algorithm identifier from an algorithm object that was created
using AI_DHKeyAgree or AI_DHKeyAgreeBER. The OID for this algorithm, excluding the
tag and length bytes, in decimal, is “42, 134, 72, 134, 247, 13, 1, 3, 1”. Also see
AI_DHKeyAgree.
Type of information this allows you to use:
the encoded algorithm identifier that specifies Diffie-Hellman key agreement as
defined in PKCS #3.
Format of info supplied to B_SetAlgorithmInfo:
pointer to an ITEM structure that gives the address and length of the BER-encoded
algorithm identifier. The encoding is converted to DER before it is copied to the
algorithm object. B_SetAlgorithmInfo returns BE_WRONG_ALGORITHM_INFO if the
algorithm identifier specifies an algorithm other than Diffie-Hellman.
Format of info returned by B_GetAlgorithmInfo:
pointer to an ITEM structure that gives the address and length of the DER-encoded
algorithm identifier.
Crypto-C procedures to use with algorithm object:
B_KeyAgreeInit, B_KeyAgreePhase1, and B_KeyAgreePhase2. You must pass an
initialized random algorithm to B_KeyAgreePhase1.
Algorithm methods to include in application’s algorithm chooser:
AM_DH_KEY_AGREE.