![]() |
![]() |
![]() |
PSKC Library Manual | ![]() |
---|---|---|---|---|
Top | Description |
enum pskc_keyusage; const char * pskc_keyusage2str (pskc_keyusage keyusage
); enum pskc_pinusagemode; const char * pskc_pinusagemode2str (pskc_pinusagemode pinusagemode
); pskc_keyusage pskc_str2keyusage (const char *keyusage
); pskc_pinusagemode pskc_str2pinusagemode (const char *pinusagemode
); pskc_valueformat pskc_str2valueformat (const char *valueformat
); enum pskc_valueformat; const char * pskc_valueformat2str (pskc_valueformat valueformat
);
The pskc_pinusagemode type describes PIN Policy Usage Modes. You
can convert between string representation and integer values using
pskc_pinusagemode2str()
and pskc_str2pinusagemode()
.
The pskc_valueformat type describes PSKC data value encodings.
You can convert between string representation and integer values
using pskc_valueformat2str()
and pskc_str2valueformat()
.
The pskc_keyusage type describes what PSKC keys may be used for.
You can convert between string representation and integer values
using pskc_keyusage2str()
and pskc_str2keyusage()
. Note that often
multiple pskc_keyusage values are ORed together to form set of
values.
typedef enum { PSKC_KEYUSAGE_UNKNOWN = 0, PSKC_KEYUSAGE_OTP = 1, PSKC_KEYUSAGE_CR = 2, PSKC_KEYUSAGE_ENCRYPT = 4, PSKC_KEYUSAGE_INTEGRITY = 8, PSKC_KEYUSAGE_VERIFY = 16, PSKC_KEYUSAGE_UNLOCK = 32, PSKC_KEYUSAGE_DECRYPT = 64, PSKC_KEYUSAGE_KEYWRAP = 128, PSKC_KEYUSAGE_UNWRAP = 256, PSKC_KEYUSAGE_DERIVE = 512, PSKC_KEYUSAGE_GENERATE = 1024, /* Make sure the following value is the highest. */ PSKC_KEYUSAGE_LAST = PSKC_KEYUSAGE_GENERATE } pskc_keyusage;
Enumeration of PSKC key usage values. These values puts constraints on the intended usage of the key. The recipient of the PSKC document MUST enforce the key usage. The values are assigned to numbers so that they can be ORed together to form a set of values.
Unknown format. | |
The key MUST only be used for OTP generation. | |
The key MUST only be used for Challenge/Response purposes. | |
The key MUST only be used for data encryption purposes. | |
The key MUST only be used to generate a keyed message digest for data integrity or authentication purposes. | |
The key MUST only be used to verify a keyed message digest for data integrity or authentication purposes (this is the opposite key usage of 'Integrity'). | |
The key MUST only be used for an inverse Challenge/ Response in the case where a user has locked the device by entering a wrong PIN too many times (for devices with PIN-input capability). | |
The key MUST only be used for data decryption purposes. | |
The key MUST only be used for key wrap purposes. | |
The key MUST only be used for key unwrap purposes. | |
The key MUST only be used with a key derivation function to derive a new key. | |
The key MUST only be used to generate a new key based on a random number and the previous value of the key. | |
Meta-value corresponding to the highest value, for use in iterating over all key usage values. |
const char * pskc_keyusage2str (pskc_keyusage keyusage
);
Convert pskc_keyusage to a string. For example,
pskc_keyusage2str(PSKC_KEYUSAGE_OTP
) will return "OTP". The
returned string must not be deallocated.
|
an pskc_keyusage enumeration type |
Returns : |
String corresponding to pskc_keyusage. |
typedef enum { PSKC_PINUSAGEMODE_UNKNOWN = 0, PSKC_PINUSAGEMODE_LOCAL = 1, PSKC_PINUSAGEMODE_PREPEND = 2, PSKC_PINUSAGEMODE_APPEND = 3, PSKC_PINUSAGEMODE_ALGORITHMIC = 4, /* Make sure the following value is the highest. */ PSKC_PINUSAGEMODE_LAST = PSKC_PINUSAGEMODE_ALGORITHMIC } pskc_pinusagemode;
Enumeration of PIN Policy Usage Modes. This indicate the way the PIN is used.
Unknown mode. | |
PIN is checked locally on the device. | |
PIN is prepended to the OTP and checked by OTP validating party. | |
PIN is appended to the OTP and checked by OTP validating party. | |
The PIN is used as part of the algorithm computation. | |
Meta-value corresponding to the highest value, for use in iterating over all usage mode values. |
const char * pskc_pinusagemode2str (pskc_pinusagemode pinusagemode
);
Convert pskc_pinusagemode to a string. For example,
pskc_pinusagemode2str(PSKC_PINUSAGEMODE_LOCAL
) will return
"Local". The returned string must not be deallocated.
|
an pskc_pinusagemode enumeration type |
Returns : |
String corresponding to pskc_pinusagemode. |
pskc_keyusage pskc_str2keyusage (const char *keyusage
);
Convert a string to a pskc_keyusage type. For example,
pskc_str2keyusage("KeyWrap") will return PSKC_KEYUSAGE_KEYWRAP
.
|
an string describing a key usage. |
Returns : |
The corresponding pskc_keyusage value. |
pskc_pinusagemode pskc_str2pinusagemode (const char *pinusagemode
);
Convert a string to a pskc_pinusagemode type. For example,
pskc_str2pinusagemode("Local") will return
PSKC_PINUSAGEMODE_LOCAL
.
|
an string describing a key usage. |
Returns : |
The corresponding pskc_pinusagemode value. |
pskc_valueformat pskc_str2valueformat (const char *valueformat
);
Convert a string to a pskc_valueformat type. For example,
pskc_str2valueformat("DECIMAL") will return
PSKC_VALUEFORMAT_DECIMAL
.
|
an string describing a key usage. |
Returns : |
The corresponding pskc_valueformat value. |
typedef enum { PSKC_VALUEFORMAT_UNKNOWN = 0, PSKC_VALUEFORMAT_DECIMAL = 1, PSKC_VALUEFORMAT_HEXADECIMAL = 2, PSKC_VALUEFORMAT_ALPHANUMERIC = 3, PSKC_VALUEFORMAT_BASE64 = 4, PSKC_VALUEFORMAT_BINARY = 5, /* Make sure the following value is the highest. */ PSKC_VALUEFORMAT_LAST = PSKC_VALUEFORMAT_BINARY } pskc_valueformat;
Enumeration of PSKC value encoding formats.
Unknown format. | |
Only numerical digits. | |
Hexadecimal response. | |
All letters and numbers (case sensitive). | |
Base-64 encoded. | |
Binary data. | |
Meta-value corresponding to the highest value, for use in iterating over all encoding format values. |
const char * pskc_valueformat2str (pskc_valueformat valueformat
);
Convert pskc_valueformat to a string. For example,
pskc_valueformat2str(PSKC_VALUEFORMAT_DECIMAL
) will return
"DECIMAL". The returned string must not be deallocated.
|
an pskc_valueformat enumeration type |
Returns : |
String corresponding to pskc_valueformat. |