• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef _GPXE_X509_H
2 #define _GPXE_X509_H
3 
4 /** @file
5  *
6  * X.509 certificates
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER );
11 
12 #include <stdint.h>
13 
14 struct asn1_cursor;
15 
16 /** An X.509 RSA public key */
17 struct x509_rsa_public_key {
18 	/** Modulus */
19 	uint8_t *modulus;
20 	/** Modulus length */
21 	size_t modulus_len;
22 	/** Exponent */
23 	uint8_t *exponent;
24 	/** Exponent length */
25 	size_t exponent_len;
26 };
27 
28 /**
29  * Free X.509 RSA public key
30  *
31  * @v rsa_pubkey	RSA public key
32  */
33 static inline void
x509_free_rsa_public_key(struct x509_rsa_public_key * rsa_pubkey)34 x509_free_rsa_public_key ( struct x509_rsa_public_key *rsa_pubkey ) {
35 	free ( rsa_pubkey->modulus );
36 }
37 
38 extern int x509_rsa_public_key ( const struct asn1_cursor *certificate,
39 				 struct x509_rsa_public_key *rsa_pubkey );
40 
41 #endif /* _GPXE_X509_H */
42