Skip to content

Commit

Permalink
fix: cryptography dep and retrocompatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Dec 14, 2022
1 parent 1e436bd commit 199c2e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cryptography==35.0.0
cryptography>=35.0.0
iso3166==2.0.2
packaging==21.2
requests>=2.26.0
Expand Down
2 changes: 1 addition & 1 deletion spid_compliant_certificates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
_min = 5

# micro version
_mic = 3
_mic = 4

# release level (alpha, beta, rc, final)
_rel = 'final'
Expand Down
20 changes: 5 additions & 15 deletions spid_compliant_certificates/validator/checks/custom_oid.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from cryptography import x509
from cryptography.hazmat._oid import ObjectIdentifier


class CustomObjectIdentifier(x509.ObjectIdentifier):
def __init__(self, dotted_string: str, name: str) -> None:
super(CustomObjectIdentifier, self).__init__(dotted_string)
self.name = name

@property
def _name(self) -> str:
return self.name


OID_INITIALS = CustomObjectIdentifier('2.5.4.43', 'initials')
OID_NAME = CustomObjectIdentifier('2.5.4.41', 'name')
OID_ORGANIZATION_IDENTIFIER = CustomObjectIdentifier('2.5.4.97', 'organizationIdentifier') # noqa
OID_URI = CustomObjectIdentifier('2.5.4.83', 'uri')
OID_INITIALS = ObjectIdentifier('2.5.4.43')
OID_NAME = ObjectIdentifier('2.5.4.41')
OID_ORGANIZATION_IDENTIFIER = ObjectIdentifier('2.5.4.97') # noqa
OID_URI = ObjectIdentifier('2.5.4.83')

0 comments on commit 199c2e5

Please sign in to comment.