xref: /dragonfly/crypto/openssh/authfile.h (revision 0cbfa66c)
10cbfa66cSDaniel Fojt /* $OpenBSD: authfile.h,v 1.25 2020/01/25 23:02:13 djm Exp $ */
218de8d7fSPeter Avalos 
318de8d7fSPeter Avalos /*
436e94dc5SPeter Avalos  * Copyright (c) 2000, 2013 Markus Friedl.  All rights reserved.
518de8d7fSPeter Avalos  *
636e94dc5SPeter Avalos  * Redistribution and use in source and binary forms, with or without
736e94dc5SPeter Avalos  * modification, are permitted provided that the following conditions
836e94dc5SPeter Avalos  * are met:
936e94dc5SPeter Avalos  * 1. Redistributions of source code must retain the above copyright
1036e94dc5SPeter Avalos  *    notice, this list of conditions and the following disclaimer.
1136e94dc5SPeter Avalos  * 2. Redistributions in binary form must reproduce the above copyright
1236e94dc5SPeter Avalos  *    notice, this list of conditions and the following disclaimer in the
1336e94dc5SPeter Avalos  *    documentation and/or other materials provided with the distribution.
1436e94dc5SPeter Avalos  *
1536e94dc5SPeter Avalos  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1636e94dc5SPeter Avalos  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1736e94dc5SPeter Avalos  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1836e94dc5SPeter Avalos  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1936e94dc5SPeter Avalos  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2036e94dc5SPeter Avalos  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2136e94dc5SPeter Avalos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2236e94dc5SPeter Avalos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2336e94dc5SPeter Avalos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2436e94dc5SPeter Avalos  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2518de8d7fSPeter Avalos  */
2618de8d7fSPeter Avalos 
2718de8d7fSPeter Avalos #ifndef AUTHFILE_H
2818de8d7fSPeter Avalos #define AUTHFILE_H
2918de8d7fSPeter Avalos 
3036e94dc5SPeter Avalos struct sshbuf;
3136e94dc5SPeter Avalos struct sshkey;
3236e94dc5SPeter Avalos 
33e9778795SPeter Avalos /* XXX document these */
34e9778795SPeter Avalos /* XXX some of these could probably be merged/retired */
35e9778795SPeter Avalos 
3636e94dc5SPeter Avalos int sshkey_save_private(struct sshkey *, const char *,
3736e94dc5SPeter Avalos     const char *, const char *, int, const char *, int);
3836e94dc5SPeter Avalos int sshkey_load_cert(const char *, struct sshkey **);
3936e94dc5SPeter Avalos int sshkey_load_public(const char *, struct sshkey **, char **);
4036e94dc5SPeter Avalos int sshkey_load_private(const char *, const char *, struct sshkey **, char **);
4136e94dc5SPeter Avalos int sshkey_load_private_cert(int, const char *, const char *,
420cbfa66cSDaniel Fojt     struct sshkey **);
4336e94dc5SPeter Avalos int sshkey_load_private_type(int, const char *, const char *,
440cbfa66cSDaniel Fojt     struct sshkey **, char **);
45e9778795SPeter Avalos int sshkey_load_private_type_fd(int fd, int type, const char *passphrase,
46e9778795SPeter Avalos     struct sshkey **keyp, char **commentp);
4736e94dc5SPeter Avalos int sshkey_perm_ok(int, const char *);
48e9778795SPeter Avalos int sshkey_in_file(struct sshkey *, const char *, int, int);
49e9778795SPeter Avalos int sshkey_check_revoked(struct sshkey *key, const char *revoked_keys_file);
500cbfa66cSDaniel Fojt int sshkey_advance_past_options(char **cpp);
510cbfa66cSDaniel Fojt int sshkey_save_public(const struct sshkey *key, const char *path,
520cbfa66cSDaniel Fojt     const char *comment);
5318de8d7fSPeter Avalos 
5418de8d7fSPeter Avalos #endif
55