File: pkcs11go.h

package info (click to toggle)
golang-github-miekg-pkcs11 1.0.3%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 400 kB
  • sloc: makefile: 20; ansic: 19
file content (29 lines) | stat: -rw-r--r-- 711 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//

#define CK_PTR *
#ifndef NULL_PTR
#define NULL_PTR 0
#endif

#include <unistd.h>
#ifdef PACKED_STRUCTURES
# pragma pack(push, 1)
# include <pkcs11.h>
# pragma pack(pop)
#else
# include <pkcs11.h>
#endif

// Copy of CK_INFO but with default alignment (not packed). Go hides unaligned
// struct fields so copying to an aligned struct is necessary to read CK_INFO
// from Go on Windows where packing is required.
typedef struct ckInfo {
	CK_VERSION cryptokiVersion;
	CK_UTF8CHAR manufacturerID[32];
	CK_FLAGS flags;
	CK_UTF8CHAR libraryDescription[32];
	CK_VERSION libraryVersion;
} ckInfo, *ckInfoPtr;