Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ssh-pkcs11-uri.h
1 /*
2  * Copyright (c) 2017 Red Hat
3  *
4  * Authors: Jakub Jelen <[email protected]>
5  *
6  * Permission to use, copy, modify, and distribute this software for any
7  * purpose with or without fee is hereby granted, provided that the above
8  * copyright notice and this permission notice appear in all copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #define PKCS11_URI_SCHEME "pkcs11:"
20 #define PKCS11_URI_WHITELIST "abcdefghijklmnopqrstuvwxyz" \
21  "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
22  "0123456789_-.()"
23 
24 struct pkcs11_uri {
25  /* path */
26  char *id;
27  size_t id_len;
28  char *token;
29  char *object;
30  char *lib_manuf;
31  char *manuf;
32  /* query */
33  char *module_path;
34  char *pin; /* Only parsed, but not printed */
35 };
36 
37 struct pkcs11_uri *pkcs11_uri_init();
38 void pkcs11_uri_cleanup(struct pkcs11_uri *);
39 int pkcs11_uri_parse(const char *, struct pkcs11_uri *);
40 struct pkcs11_uri *pkcs11_uri_init();
41 char *pkcs11_uri_get(struct pkcs11_uri *uri);
42