asymmetric-parser.h 1012 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* Asymmetric public-key cryptography data parser
  3. *
  4. * See Documentation/crypto/asymmetric-keys.rst
  5. *
  6. * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
  7. * Written by David Howells (dhowells@redhat.com)
  8. */
  9. #ifndef _KEYS_ASYMMETRIC_PARSER_H
  10. #define _KEYS_ASYMMETRIC_PARSER_H
  11. struct key_preparsed_payload;
  12. /*
  13. * Key data parser. Called during key instantiation.
  14. */
  15. struct asymmetric_key_parser {
  16. struct list_head link;
  17. struct module *owner;
  18. const char *name;
  19. /* Attempt to parse a key from the data blob passed to add_key() or
  20. * keyctl_instantiate(). Should also generate a proposed description
  21. * that the caller can optionally use for the key.
  22. *
  23. * Return EBADMSG if not recognised.
  24. */
  25. int (*parse)(struct key_preparsed_payload *prep);
  26. };
  27. extern int register_asymmetric_key_parser(struct asymmetric_key_parser *);
  28. extern void unregister_asymmetric_key_parser(struct asymmetric_key_parser *);
  29. #endif /* _KEYS_ASYMMETRIC_PARSER_H */