You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

x509.h 728B

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