Development of an internal social media platform with personalised dashboards for students
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.

rfc3062.py 2.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. """
  2. """
  3. # Created on 2014.04.28
  4. #
  5. # Author: Giovanni Cannata
  6. #
  7. # Copyright 2014 - 2018 Giovanni Cannata
  8. #
  9. # This file is part of ldap3.
  10. #
  11. # ldap3 is free software: you can redistribute it and/or modify
  12. # it under the terms of the GNU Lesser General Public License as published
  13. # by the Free Software Foundation, either version 3 of the License, or
  14. # (at your option) any later version.
  15. #
  16. # ldap3 is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU Lesser General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU Lesser General Public License
  22. # along with ldap3 in the COPYING and COPYING.LESSER files.
  23. # If not, see <http://www.gnu.org/licenses/>.
  24. from pyasn1.type.univ import OctetString, Sequence
  25. from pyasn1.type.namedtype import NamedTypes, OptionalNamedType
  26. from pyasn1.type.tag import Tag, tagClassContext, tagFormatSimple
  27. # Modify password extended operation
  28. # passwdModifyOID OBJECT IDENTIFIER ::= 1.3.6.1.4.1.4203.1.11.1
  29. # PasswdModifyRequestValue ::= SEQUENCE {
  30. # userIdentity [0] OCTET STRING OPTIONAL
  31. # oldPasswd [1] OCTET STRING OPTIONAL
  32. # newPasswd [2] OCTET STRING OPTIONAL }
  33. #
  34. # PasswdModifyResponseValue ::= SEQUENCE {
  35. # genPasswd [0] OCTET STRING OPTIONAL }
  36. class UserIdentity(OctetString):
  37. """
  38. userIdentity [0] OCTET STRING OPTIONAL
  39. """
  40. tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0))
  41. encoding = 'utf-8'
  42. class OldPasswd(OctetString):
  43. """
  44. oldPasswd [1] OCTET STRING OPTIONAL
  45. """
  46. tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 1))
  47. encoding = 'utf-8'
  48. class NewPasswd(OctetString):
  49. """
  50. newPasswd [2] OCTET STRING OPTIONAL
  51. """
  52. tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 2))
  53. encoding = 'utf-8'
  54. class GenPasswd(OctetString):
  55. """
  56. newPasswd [2] OCTET STRING OPTIONAL
  57. """
  58. tagSet = OctetString.tagSet.tagImplicitly(Tag(tagClassContext, tagFormatSimple, 0))
  59. encoding = 'utf-8'
  60. class PasswdModifyRequestValue(Sequence):
  61. """
  62. PasswdModifyRequestValue ::= SEQUENCE {
  63. userIdentity [0] OCTET STRING OPTIONAL
  64. oldPasswd [1] OCTET STRING OPTIONAL
  65. newPasswd [2] OCTET STRING OPTIONAL }
  66. """
  67. componentType = NamedTypes(OptionalNamedType('userIdentity', UserIdentity()),
  68. OptionalNamedType('oldPasswd', OldPasswd()),
  69. OptionalNamedType('newPasswd', NewPasswd()))
  70. class PasswdModifyResponseValue(Sequence):
  71. """
  72. PasswdModifyResponseValue ::= SEQUENCE {
  73. genPasswd [0] OCTET STRING OPTIONAL }
  74. """
  75. componentType = NamedTypes(OptionalNamedType('genPasswd', GenPasswd()))