rfc3058.py 992 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #
  2. # This file is part of pyasn1-modules software.
  3. #
  4. # Created by Russ Housley.
  5. #
  6. # Copyright (c) 2019, Vigil Security, LLC
  7. # License: http://snmplabs.com/pyasn1/license.html
  8. #
  9. # IDEA Encryption Algorithm in CMS
  10. #
  11. # ASN.1 source from:
  12. # https://www.rfc-editor.org/rfc/rfc3058.txt
  13. # https://www.rfc-editor.org/errata/eid5913
  14. #
  15. from pyasn1.type import namedtype
  16. from pyasn1.type import univ
  17. from pyasn1_modules import rfc5280
  18. id_IDEA_CBC = univ.ObjectIdentifier('1.3.6.1.4.1.188.7.1.1.2')
  19. id_alg_CMSIDEAwrap = univ.ObjectIdentifier('1.3.6.1.4.1.188.7.1.1.6')
  20. class IDEA_CBCPar(univ.Sequence):
  21. componentType = namedtype.NamedTypes(
  22. namedtype.OptionalNamedType('iv', univ.OctetString())
  23. # exactly 8 octets, when present
  24. )
  25. # Update the Algorithm Identifier map in rfc5280.py.
  26. _algorithmIdentifierMapUpdate = {
  27. id_IDEA_CBC: IDEA_CBCPar(),
  28. id_alg_CMSIDEAwrap: univ.Null("")
  29. }
  30. rfc5280.algorithmIdentifierMap.update(_algorithmIdentifierMapUpdate)