Wire Sysio
Wire Sysion 1.0.0
Loading...
Searching...
No Matches
yubihsm-shell.h
Go to the documentation of this file.
1
/*
2
* Copyright 2015-2018 Yubico AB
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef YUBIHSM_SHELL_H
18
#define YUBIHSM_SHELL_H
19
20
#include <assert.h>
21
22
#include <
yubihsm.h
>
23
#include <
ykyh.h
>
24
#include <cmdline.h>
25
26
#define UNUSED(x) (void) (x)
27
28
typedef
enum
{
29
fmt_nofmt
,
30
fmt_base64
,
31
fmt_binary
,
32
fmt_hex
,
33
fmt_PEM
,
34
fmt_password
,
35
fmt_ASCII
36
}
cmd_format
;
37
38
static
const
struct
{
39
const
char
*
name
;
40
cmd_format
format
;
41
} formats[] = {
42
{
"base64"
,
fmt_base64
}, {
"binary"
,
fmt_binary
}, {
"hex"
,
fmt_hex
},
43
{
"PEM"
,
fmt_PEM
}, {
"password"
,
fmt_password
}, {
"ASCII"
,
fmt_ASCII
},
44
};
45
46
typedef
struct
{
47
char
**
connector_list
;
48
yh_connector
*
connector
;
49
int
n_connectors
;
50
yh_session
*sessions[
YH_MAX_SESSIONS
];
51
ykyh_state
*
state
;
52
FILE *
out
;
53
cmd_format
in_fmt
;
54
cmd_format
out_fmt
;
55
char
*
cacert
;
56
char
*
proxy
;
57
}
yubihsm_context
;
58
59
int
actions_run
(
struct
gengetopt_args_info *args_info);
60
int
do_put_key
(
uint8_t
*enc_key,
uint8_t
*mac_key,
uint16_t
key_id
,
61
uint16_t
domains
,
uint32_t
capabilities
,
yh_session
*
ses
);
62
63
#endif
uint16_t
unsigned short uint16_t
Definition
stdint.h:125
uint32_t
unsigned int uint32_t
Definition
stdint.h:126
uint8_t
unsigned char uint8_t
Definition
stdint.h:124
yh_connector
Definition
internal.h:37
yh_session
Definition
internal.h:25
ykyh_state
Definition
internal.h:34
yubihsm_context
Definition
yubihsm-shell.h:46
yubihsm_context::state
ykyh_state * state
Definition
yubihsm-shell.h:51
yubihsm_context::n_connectors
int n_connectors
Definition
yubihsm-shell.h:49
yubihsm_context::out
FILE * out
Definition
yubihsm-shell.h:52
yubihsm_context::in_fmt
cmd_format in_fmt
Definition
yubihsm-shell.h:53
yubihsm_context::connector
yh_connector * connector
Definition
yubihsm-shell.h:48
yubihsm_context::cacert
char * cacert
Definition
yubihsm-shell.h:55
yubihsm_context::proxy
char * proxy
Definition
yubihsm-shell.h:56
yubihsm_context::out_fmt
cmd_format out_fmt
Definition
yubihsm-shell.h:54
yubihsm_context::connector_list
char ** connector_list
Definition
yubihsm-shell.h:47
ykyh.h
actions_run
int actions_run(struct gengetopt_args_info *args_info)
cmd_format
cmd_format
Definition
yubihsm-shell.h:28
fmt_nofmt
@ fmt_nofmt
Definition
yubihsm-shell.h:29
fmt_ASCII
@ fmt_ASCII
Definition
yubihsm-shell.h:35
fmt_binary
@ fmt_binary
Definition
yubihsm-shell.h:31
fmt_PEM
@ fmt_PEM
Definition
yubihsm-shell.h:33
fmt_hex
@ fmt_hex
Definition
yubihsm-shell.h:32
fmt_password
@ fmt_password
Definition
yubihsm-shell.h:34
fmt_base64
@ fmt_base64
Definition
yubihsm-shell.h:30
name
const char * name
Definition
yubihsm-shell.h:39
do_put_key
int do_put_key(uint8_t *enc_key, uint8_t *mac_key, uint16_t key_id, uint16_t domains, uint32_t capabilities, yh_session *ses)
format
cmd_format format
Definition
yubihsm-shell.h:40
yubihsm.h
YH_MAX_SESSIONS
#define YH_MAX_SESSIONS
Max sessions the device may hold.
Definition
yubihsm.h:105
capabilities
yh_capabilities capabilities
Definition
yubihsm_pkcs11.c:1305
domains
uint16_t domains
Definition
yubihsm_pkcs11.c:1926
key_id
uint16_t key_id
Definition
yubihsm_pkcs11.c:1104
ses
yh_session * ses
Definition
yubihsm_shell_tests.c:28
libraries
yubihsm
src
yubihsm-shell.h
Generated by
1.12.0