blob: 83800e12889938dbca0fbfc8fd02f02f4359ad16 [file] [log] [blame]
Jess Frazelle2b0bc862016-09-22 09:49:45 -07001// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4//
5// * Redistributions of source code must retain the above copyright
6// notice, this list of conditions and the following disclaimer.
7//
8// * Redistributions in binary form must reproduce the above
9// copyright notice, this list of conditions and the following
10// disclaimer in the documentation and/or other materials provided
11// with the distribution.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
14// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
15// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
16// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
17// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
18// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
19// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25
Jess Frazelle12739d52016-09-22 17:06:37 -070026// WARNING: This file has automatically been generated on Thu, 22 Sep 2016 22:57:19 UTC.
Jess Frazelle2b0bc862016-09-22 09:49:45 -070027// By https://git.io/cgogen. DO NOT EDIT.
28
29package ykpiv
30
31/*
Jess Frazelle331ef482016-09-22 15:01:36 -070032#cgo LDFLAGS: -lykpiv -lcrypto -lpcsclite -lpthread
Jess Frazelle2b0bc862016-09-22 09:49:45 -070033#include "ykpiv.h"
34#include <stdlib.h>
35#include "cgo_helpers.h"
36*/
37import "C"
38
39const (
40 // ALGOTAG as defined in ykpiv/ykpiv.h:113
41 ALGOTAG = 0x80
42 // ALGO3DES as defined in ykpiv/ykpiv.h:114
43 ALGO3DES = 0x03
44 // ALGORSA1024 as defined in ykpiv/ykpiv.h:115
45 ALGORSA1024 = 0x06
46 // ALGORSA2048 as defined in ykpiv/ykpiv.h:116
47 ALGORSA2048 = 0x07
48 // ALGOECCP256 as defined in ykpiv/ykpiv.h:117
49 ALGOECCP256 = 0x11
50 // ALGOECCP384 as defined in ykpiv/ykpiv.h:118
51 ALGOECCP384 = 0x14
52 // KEYAUTHENTICATION as defined in ykpiv/ykpiv.h:120
53 KEYAUTHENTICATION = 0x9a
54 // KEYCARDMGM as defined in ykpiv/ykpiv.h:121
55 KEYCARDMGM = 0x9b
56 // KEYSIGNATURE as defined in ykpiv/ykpiv.h:122
57 KEYSIGNATURE = 0x9c
58 // KEYKEYMGM as defined in ykpiv/ykpiv.h:123
59 KEYKEYMGM = 0x9d
60 // KEYCARDAUTH as defined in ykpiv/ykpiv.h:124
61 KEYCARDAUTH = 0x9e
62 // KEYRETIRED1 as defined in ykpiv/ykpiv.h:125
63 KEYRETIRED1 = 0x82
64 // KEYRETIRED2 as defined in ykpiv/ykpiv.h:126
65 KEYRETIRED2 = 0x83
66 // KEYRETIRED3 as defined in ykpiv/ykpiv.h:127
67 KEYRETIRED3 = 0x84
68 // KEYRETIRED4 as defined in ykpiv/ykpiv.h:128
69 KEYRETIRED4 = 0x85
70 // KEYRETIRED5 as defined in ykpiv/ykpiv.h:129
71 KEYRETIRED5 = 0x86
72 // KEYRETIRED6 as defined in ykpiv/ykpiv.h:130
73 KEYRETIRED6 = 0x87
74 // KEYRETIRED7 as defined in ykpiv/ykpiv.h:131
75 KEYRETIRED7 = 0x88
76 // KEYRETIRED8 as defined in ykpiv/ykpiv.h:132
77 KEYRETIRED8 = 0x89
78 // KEYRETIRED9 as defined in ykpiv/ykpiv.h:133
79 KEYRETIRED9 = 0x8a
80 // KEYRETIRED10 as defined in ykpiv/ykpiv.h:134
81 KEYRETIRED10 = 0x8b
82 // KEYRETIRED11 as defined in ykpiv/ykpiv.h:135
83 KEYRETIRED11 = 0x8c
84 // KEYRETIRED12 as defined in ykpiv/ykpiv.h:136
85 KEYRETIRED12 = 0x8d
86 // KEYRETIRED13 as defined in ykpiv/ykpiv.h:137
87 KEYRETIRED13 = 0x8e
88 // KEYRETIRED14 as defined in ykpiv/ykpiv.h:138
89 KEYRETIRED14 = 0x8f
90 // KEYRETIRED15 as defined in ykpiv/ykpiv.h:139
91 KEYRETIRED15 = 0x90
92 // KEYRETIRED16 as defined in ykpiv/ykpiv.h:140
93 KEYRETIRED16 = 0x91
94 // KEYRETIRED17 as defined in ykpiv/ykpiv.h:141
95 KEYRETIRED17 = 0x92
96 // KEYRETIRED18 as defined in ykpiv/ykpiv.h:142
97 KEYRETIRED18 = 0x93
98 // KEYRETIRED19 as defined in ykpiv/ykpiv.h:143
99 KEYRETIRED19 = 0x94
100 // KEYRETIRED20 as defined in ykpiv/ykpiv.h:144
101 KEYRETIRED20 = 0x95
102 // KEYATTESTATION as defined in ykpiv/ykpiv.h:145
103 KEYATTESTATION = 0xf9
104 // OBJCAPABILITY as defined in ykpiv/ykpiv.h:147
105 OBJCAPABILITY = 0x5fc107
106 // OBJCHUID as defined in ykpiv/ykpiv.h:148
107 OBJCHUID = 0x5fc102
108 // OBJAUTHENTICATION as defined in ykpiv/ykpiv.h:149
109 OBJAUTHENTICATION = 0x5fc105
110 // OBJFINGERPRINTS as defined in ykpiv/ykpiv.h:150
111 OBJFINGERPRINTS = 0x5fc103
112 // OBJSECURITY as defined in ykpiv/ykpiv.h:151
113 OBJSECURITY = 0x5fc106
114 // OBJFACIAL as defined in ykpiv/ykpiv.h:152
115 OBJFACIAL = 0x5fc108
116 // OBJPRINTED as defined in ykpiv/ykpiv.h:153
117 OBJPRINTED = 0x5fc109
118 // OBJSIGNATURE as defined in ykpiv/ykpiv.h:154
119 OBJSIGNATURE = 0x5fc10a
120 // OBJKEYMANAGEMENT as defined in ykpiv/ykpiv.h:155
121 OBJKEYMANAGEMENT = 0x5fc10b
122 // OBJCARDAUTH as defined in ykpiv/ykpiv.h:156
123 OBJCARDAUTH = 0x5fc101
124 // OBJDISCOVERY as defined in ykpiv/ykpiv.h:157
125 OBJDISCOVERY = 0x7e
126 // OBJKEYHISTORY as defined in ykpiv/ykpiv.h:158
127 OBJKEYHISTORY = 0x5fc10c
128 // OBJIRIS as defined in ykpiv/ykpiv.h:159
129 OBJIRIS = 0x5fc121
130 // OBJRETIRED1 as defined in ykpiv/ykpiv.h:161
131 OBJRETIRED1 = 0x5fc10d
132 // OBJRETIRED2 as defined in ykpiv/ykpiv.h:162
133 OBJRETIRED2 = 0x5fc10e
134 // OBJRETIRED3 as defined in ykpiv/ykpiv.h:163
135 OBJRETIRED3 = 0x5fc10f
136 // OBJRETIRED4 as defined in ykpiv/ykpiv.h:164
137 OBJRETIRED4 = 0x5fc110
138 // OBJRETIRED5 as defined in ykpiv/ykpiv.h:165
139 OBJRETIRED5 = 0x5fc111
140 // OBJRETIRED6 as defined in ykpiv/ykpiv.h:166
141 OBJRETIRED6 = 0x5fc112
142 // OBJRETIRED7 as defined in ykpiv/ykpiv.h:167
143 OBJRETIRED7 = 0x5fc113
144 // OBJRETIRED8 as defined in ykpiv/ykpiv.h:168
145 OBJRETIRED8 = 0x5fc114
146 // OBJRETIRED9 as defined in ykpiv/ykpiv.h:169
147 OBJRETIRED9 = 0x5fc115
148 // OBJRETIRED10 as defined in ykpiv/ykpiv.h:170
149 OBJRETIRED10 = 0x5fc116
150 // OBJRETIRED11 as defined in ykpiv/ykpiv.h:171
151 OBJRETIRED11 = 0x5fc117
152 // OBJRETIRED12 as defined in ykpiv/ykpiv.h:172
153 OBJRETIRED12 = 0x5fc118
154 // OBJRETIRED13 as defined in ykpiv/ykpiv.h:173
155 OBJRETIRED13 = 0x5fc119
156 // OBJRETIRED14 as defined in ykpiv/ykpiv.h:174
157 OBJRETIRED14 = 0x5fc11a
158 // OBJRETIRED15 as defined in ykpiv/ykpiv.h:175
159 OBJRETIRED15 = 0x5fc11b
160 // OBJRETIRED16 as defined in ykpiv/ykpiv.h:176
161 OBJRETIRED16 = 0x5fc11c
162 // OBJRETIRED17 as defined in ykpiv/ykpiv.h:177
163 OBJRETIRED17 = 0x5fc11d
164 // OBJRETIRED18 as defined in ykpiv/ykpiv.h:178
165 OBJRETIRED18 = 0x5fc11e
166 // OBJRETIRED19 as defined in ykpiv/ykpiv.h:179
167 OBJRETIRED19 = 0x5fc11f
168 // OBJRETIRED20 as defined in ykpiv/ykpiv.h:180
169 OBJRETIRED20 = 0x5fc120
170 // OBJATTESTATION as defined in ykpiv/ykpiv.h:182
171 OBJATTESTATION = 0x5fff01
172 // INSVERIFY as defined in ykpiv/ykpiv.h:184
173 INSVERIFY = 0x20
174 // INSCHANGEREFERENCE as defined in ykpiv/ykpiv.h:185
175 INSCHANGEREFERENCE = 0x24
176 // INSRESETRETRY as defined in ykpiv/ykpiv.h:186
177 INSRESETRETRY = 0x2c
178 // INSGENERATEASYMMETRIC as defined in ykpiv/ykpiv.h:187
179 INSGENERATEASYMMETRIC = 0x47
180 // INSAUTHENTICATE as defined in ykpiv/ykpiv.h:188
181 INSAUTHENTICATE = 0x87
182 // INSGETDATA as defined in ykpiv/ykpiv.h:189
183 INSGETDATA = 0xcb
184 // INSPUTDATA as defined in ykpiv/ykpiv.h:190
185 INSPUTDATA = 0xdb
186 // INSSETMGMKEY as defined in ykpiv/ykpiv.h:201
187 INSSETMGMKEY = 0xff
188 // INSIMPORTKEY as defined in ykpiv/ykpiv.h:202
189 INSIMPORTKEY = 0xfe
190 // INSGETVERSION as defined in ykpiv/ykpiv.h:203
191 INSGETVERSION = 0xfd
192 // INSRESET as defined in ykpiv/ykpiv.h:204
193 INSRESET = 0xfb
194 // INSSETPINRETRIES as defined in ykpiv/ykpiv.h:205
195 INSSETPINRETRIES = 0xfa
196 // INSATTEST as defined in ykpiv/ykpiv.h:206
197 INSATTEST = 0xf9
198 // PINPOLICYTAG as defined in ykpiv/ykpiv.h:208
199 PINPOLICYTAG = 0xaa
200 // PINPOLICYDEFAULT as defined in ykpiv/ykpiv.h:209
201 PINPOLICYDEFAULT = 0
202 // PINPOLICYNEVER as defined in ykpiv/ykpiv.h:210
203 PINPOLICYNEVER = 1
204 // PINPOLICYONCE as defined in ykpiv/ykpiv.h:211
205 PINPOLICYONCE = 2
206 // PINPOLICYALWAYS as defined in ykpiv/ykpiv.h:212
207 PINPOLICYALWAYS = 3
208 // TOUCHPOLICYTAG as defined in ykpiv/ykpiv.h:214
209 TOUCHPOLICYTAG = 0xab
210 // TOUCHPOLICYDEFAULT as defined in ykpiv/ykpiv.h:215
211 TOUCHPOLICYDEFAULT = 0
212 // TOUCHPOLICYNEVER as defined in ykpiv/ykpiv.h:216
213 TOUCHPOLICYNEVER = 1
214 // TOUCHPOLICYALWAYS as defined in ykpiv/ykpiv.h:217
215 TOUCHPOLICYALWAYS = 2
216 // TOUCHPOLICYCACHED as defined in ykpiv/ykpiv.h:218
217 TOUCHPOLICYCACHED = 3
218 // VERSIONSTRING as defined in lib/ykpiv-version.h:46
219 VERSIONSTRING = "1.4.2"
220 // VERSIONNUMBER as defined in lib/ykpiv-version.h:56
221 VERSIONNUMBER = 0x010402
222 // VERSIONMAJOR as defined in lib/ykpiv-version.h:65
223 VERSIONMAJOR = 1
224 // VERSIONMINOR as defined in lib/ykpiv-version.h:74
225 VERSIONMINOR = 4
226 // VERSIONPATCH as defined in lib/ykpiv-version.h:83
227 VERSIONPATCH = 2
228)
229
230// Rc as declared in ykpiv/ykpiv.h:61
231type Rc int32
232
233// Rc enumeration from ykpiv/ykpiv.h:61
234const (
235 OK Rc = iota
236 MEMORYERROR Rc = -1
237 PCSCERROR Rc = -2
238 SIZEERROR Rc = -3
239 APPLETERROR Rc = -4
240 AUTHENTICATIONERROR Rc = -5
241 RANDOMNESSERROR Rc = -6
242 GENERICERROR Rc = -7
243 KEYERROR Rc = -8
244 PARSEERROR Rc = -9
245 WRONGPIN Rc = -10
246 INVALIDOBJECT Rc = -11
247 ALGORITHMERROR Rc = -12
248 PINLOCKED Rc = -13
249)