Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added pymdoccbor/mdoc/__init__.py
Empty file.
4 changes: 3 additions & 1 deletion pymdoccbor/mso/issuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import secrets
import uuid

from datetime import timezone

from pycose.headers import Algorithm, KID
from pycose.keys import CoseKey, EC2Key
from pycose.messages import Sign1Message
Expand Down Expand Up @@ -137,7 +139,7 @@ def sign(
:return: the signed mso
:rtype: Sign1Message
"""
utcnow = datetime.datetime.utcnow()
utcnow = datetime.datetime.now(timezone.utc)
if settings.PYMDOC_EXP_DELTA_HOURS:
exp = utcnow + datetime.timedelta(
hours=settings.PYMDOC_EXP_DELTA_HOURS
Expand Down
6 changes: 4 additions & 2 deletions pymdoccbor/settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import datetime
import os

from datetime import timezone

COSEKEY_HAZMAT_CRV_MAP = {
"secp256r1": "P_256",
"secp384r1": "P_384",
Expand Down Expand Up @@ -34,11 +36,11 @@
X509_ORGANIZATION_NAME = os.getenv('X509_ORGANIZATION_NAME', u"My Company")
X509_COMMON_NAME = os.getenv('X509_COMMON_NAME', u"mysite.com")

X509_NOT_VALID_BEFORE = os.getenv('X509_NOT_VALID_BEFORE', datetime.datetime.utcnow())
X509_NOT_VALID_BEFORE = os.getenv('X509_NOT_VALID_BEFORE', datetime.datetime.now(timezone.utc))
X509_NOT_VALID_AFTER_DAYS = os.getenv('X509_NOT_VALID_AFTER_DAYS', 10)
X509_NOT_VALID_AFTER = os.getenv(
'X509_NOT_VALID_AFTER',
datetime.datetime.utcnow() + datetime.timedelta(
datetime.datetime.now(timezone.utc) + datetime.timedelta(
days=X509_NOT_VALID_AFTER_DAYS
)
)
Expand Down
16 changes: 4 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import re

from glob import glob
from setuptools import setup
from setuptools import setup, find_packages

def readme():
with open('README.md') as f:
Expand Down Expand Up @@ -31,15 +29,9 @@ def readme():
url='https://github.com/peppelinux/pyMDL-MDOC',
author='Giuseppe De Marco',
author_email='demarcog83@gmail.com',
license='License :: OSI Approved :: Apache Software License',
# scripts=[f'{_pkg_name}/bin/{_pkg_name}'],
packages=[f"{_pkg_name}"],
package_dir={f"{_pkg_name}": f"{_pkg_name}"},
package_data={f"{_pkg_name}": [
i.replace(f'{_pkg_name}/', '')
for i in glob(f'{_pkg_name}/**', recursive=True)
]
},
license='Apache Software License',
packages=find_packages(include=["pymdoccbor", "pymdoccbor.*"]),
include_package_data=True,
install_requires=[
'cbor2>=5.4.0,<5.5.0',
'cwt>=2.3.0,<2.4',
Expand Down