A SERVICE OF

logo

Chapter 4 Details of Crypto-C Functions 331
B_SetKeyInfo
B_SetKeyInfo
Description
B_SetKeyInfo sets the value of
keyObject
to the information pointed to by
info
. The
format of the information is specified by
infoType
, which is one of the key info types
with a
KI_ prefix listed in Chapter 3. Also, some of the AI algorithm info types listed
in Chapter 2 specify the key info type that should be used to set the key object needed
by the algorithm. A separate copy of the information supplied by
info
is allocated
inside the key object so that
info
may be changed after the call to B_SetKeyInfo.
B_SetKeyInfo returns BE_WRONG_KEY_INFO if the key type encoded in
info
is not the
type expected by
infoType.
Once a key object has been set, it should not be reset; that is, do not call B_SetKeyInfo
twice on a single created key object. Either create a new key object, or destroy an
existing one and create it again.
Return value
int B_SetKeyInfo (
B_KEY_OBJ keyObject, /* key object */
B_INFO_TYPE infoType, /* type of key information */
POINTER info /* key information */
);
Value Description
0 Operation was successful.
non-zero see Appendix A, ”Crypto-C Error Types”