xref: /freebsd/crypto/openssh/regress/unittests/sshkey/common.h (revision c6879c6c14eedbd060ba588a3129a6c60ebbe783)
1*2a01feabSEd Maste /* 	$OpenBSD: common.h,v 1.2 2018/09/13 09:03:20 djm Exp $ */
2a0ee8cc6SDag-Erling Smørgrav /*
3a0ee8cc6SDag-Erling Smørgrav  * Helpers for key API tests
4a0ee8cc6SDag-Erling Smørgrav  *
5a0ee8cc6SDag-Erling Smørgrav  * Placed in the public domain
6a0ee8cc6SDag-Erling Smørgrav  */
7a0ee8cc6SDag-Erling Smørgrav 
8a0ee8cc6SDag-Erling Smørgrav /* Load a binary file into a buffer */
9a0ee8cc6SDag-Erling Smørgrav struct sshbuf *load_file(const char *name);
10a0ee8cc6SDag-Erling Smørgrav 
11a0ee8cc6SDag-Erling Smørgrav /* Load a text file into a buffer */
12a0ee8cc6SDag-Erling Smørgrav struct sshbuf *load_text_file(const char *name);
13a0ee8cc6SDag-Erling Smørgrav 
14a0ee8cc6SDag-Erling Smørgrav /* Load a bignum from a file */
15a0ee8cc6SDag-Erling Smørgrav BIGNUM *load_bignum(const char *name);
16a0ee8cc6SDag-Erling Smørgrav 
17*2a01feabSEd Maste /* Accessors for key components */
18*2a01feabSEd Maste const BIGNUM *rsa_n(struct sshkey *k);
19*2a01feabSEd Maste const BIGNUM *rsa_e(struct sshkey *k);
20*2a01feabSEd Maste const BIGNUM *rsa_p(struct sshkey *k);
21*2a01feabSEd Maste const BIGNUM *rsa_q(struct sshkey *k);
22*2a01feabSEd Maste const BIGNUM *dsa_g(struct sshkey *k);
23*2a01feabSEd Maste const BIGNUM *dsa_pub_key(struct sshkey *k);
24*2a01feabSEd Maste const BIGNUM *dsa_priv_key(struct sshkey *k);
25*2a01feabSEd Maste 
26