asymmetric-parser.h 981 B

123456789101112131415161718192021222324252627282930313233
  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 ([email protected])
  8. */
  9. #ifndef _KEYS_ASYMMETRIC_PARSER_H
  10. #define _KEYS_ASYMMETRIC_PARSER_H
  11. /*
  12. * Key data parser. Called during key instantiation.
  13. */
  14. struct asymmetric_key_parser {
  15. struct list_head link;
  16. struct module *owner;
  17. const char *name;
  18. /* Attempt to parse a key from the data blob passed to add_key() or
  19. * keyctl_instantiate(). Should also generate a proposed description
  20. * that the caller can optionally use for the key.
  21. *
  22. * Return EBADMSG if not recognised.
  23. */
  24. int (*parse)(struct key_preparsed_payload *prep);
  25. };
  26. extern int register_asymmetric_key_parser(struct asymmetric_key_parser *);
  27. extern void unregister_asymmetric_key_parser(struct asymmetric_key_parser *);
  28. #endif /* _KEYS_ASYMMETRIC_PARSER_H */