asn1.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /* ASN.1 BER/DER/CER encoding definitions
  3. *
  4. * Copyright (C) 2012 Red Hat, Inc. All Rights Reserved.
  5. * Written by David Howells (dhowells@redhat.com)
  6. */
  7. #ifndef _LINUX_ASN1_H
  8. #define _LINUX_ASN1_H
  9. /* Class */
  10. enum asn1_class {
  11. ASN1_UNIV = 0, /* Universal */
  12. ASN1_APPL = 1, /* Application */
  13. ASN1_CONT = 2, /* Context */
  14. ASN1_PRIV = 3 /* Private */
  15. };
  16. #define ASN1_CLASS_BITS 0xc0
  17. enum asn1_method {
  18. ASN1_PRIM = 0, /* Primitive */
  19. ASN1_CONS = 1 /* Constructed */
  20. };
  21. #define ASN1_CONS_BIT 0x20
  22. /* Tag */
  23. enum asn1_tag {
  24. ASN1_EOC = 0, /* End Of Contents or N/A */
  25. ASN1_BOOL = 1, /* Boolean */
  26. ASN1_INT = 2, /* Integer */
  27. ASN1_BTS = 3, /* Bit String */
  28. ASN1_OTS = 4, /* Octet String */
  29. ASN1_NULL = 5, /* Null */
  30. ASN1_OID = 6, /* Object Identifier */
  31. ASN1_ODE = 7, /* Object Description */
  32. ASN1_EXT = 8, /* External */
  33. ASN1_REAL = 9, /* Real float */
  34. ASN1_ENUM = 10, /* Enumerated */
  35. ASN1_EPDV = 11, /* Embedded PDV */
  36. ASN1_UTF8STR = 12, /* UTF8 String */
  37. ASN1_RELOID = 13, /* Relative OID */
  38. /* 14 - Reserved */
  39. /* 15 - Reserved */
  40. ASN1_SEQ = 16, /* Sequence and Sequence of */
  41. ASN1_SET = 17, /* Set and Set of */
  42. ASN1_NUMSTR = 18, /* Numerical String */
  43. ASN1_PRNSTR = 19, /* Printable String */
  44. ASN1_TEXSTR = 20, /* T61 String / Teletext String */
  45. ASN1_VIDSTR = 21, /* Videotex String */
  46. ASN1_IA5STR = 22, /* IA5 String */
  47. ASN1_UNITIM = 23, /* Universal Time */
  48. ASN1_GENTIM = 24, /* General Time */
  49. ASN1_GRASTR = 25, /* Graphic String */
  50. ASN1_VISSTR = 26, /* Visible String */
  51. ASN1_GENSTR = 27, /* General String */
  52. ASN1_UNISTR = 28, /* Universal String */
  53. ASN1_CHRSTR = 29, /* Character String */
  54. ASN1_BMPSTR = 30, /* BMP String */
  55. ASN1_LONG_TAG = 31 /* Long form tag */
  56. };
  57. #define ASN1_INDEFINITE_LENGTH 0x80
  58. #endif /* _LINUX_ASN1_H */