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 695B

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