1.. _mozilla_projects_nss_reference_fc_setoperationstate:
2
3FC_SetOperationState
4====================
5
6`Name <#name>`__
7~~~~~~~~~~~~~~~~
8
9.. container::
10
11   FC_SetOperationState - restore the cryptographic operation state of a session.
12
13`Syntax <#syntax>`__
14~~~~~~~~~~~~~~~~~~~~
15
16.. container::
17
18   .. code:: eval
19
20      CK_RV FC_SetOperationState(
21        CK_SESSION_HANDLE hSession,
22        CK_BYTE_PTR pOperationState,
23        CK_ULONG ulOperationStateLen,
24        CK_OBJECT_HANDLE hEncryptionKey,
25        CK_OBJECT_HANDLE hAuthenticationKey
26      );
27
28`Parameters <#parameters>`__
29~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30
31.. container::
32
33   ``hSession``
34      [in] handle of the open session.
35   ``pOperationState``
36      [in] pointer to a byte array containing the operation state.
37   ``ulOperationStateLen``
38      [in] contains the total length (in bytes) of the operation state.
39   ``hEncryptionKey``
40      [in] handle of the encryption or decryption key to be used in a stored session or zero if no
41      key is needed.
42   ``hAuthenticationKey``
43      [in] handle of the authentication key to be used in the stored session or zero if none is
44      needed.
45
46`Description <#description>`__
47~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48
49.. container::
50
51   ``FC_SetOperationState`` restores the cryptographic operations state of a session from an array
52   of bytes obtained with ``FC_GetOperationState``. This function only works for digest operations
53   for now. Therefore, a user may call ``FC_SetOperationState`` without logging into the token (to
54   assume the NSS User role).
55
56.. _return_value:
57
58`Return value <#return_value>`__
59~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60
61.. container::
62
63`Examples <#examples>`__
64~~~~~~~~~~~~~~~~~~~~~~~~
65
66.. container::
67
68.. _see_also:
69
70`See also <#see_also>`__
71~~~~~~~~~~~~~~~~~~~~~~~~
72
73.. container::
74
75   -  :ref:`mozilla_projects_nss_reference_fc_getoperationstate`,
76      `NSC_SetOperationState </en-US/NSC_SetOperationState>`__