package/python-rsa: new package
authorRaphaël Mélotte <raphael.melotte@essensium.com>
Fri, 7 Feb 2020 14:16:28 +0000 (15:16 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 4 Aug 2021 20:27:28 +0000 (22:27 +0200)
Python-RSA is a pure-Python RSA implementation.

Signed-off-by: Raphaël Mélotte <raphael.melotte@essensium.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
DEVELOPERS
package/Config.in
package/python-rsa/Config.in [new file with mode: 0644]
package/python-rsa/python-rsa.hash [new file with mode: 0644]
package/python-rsa/python-rsa.mk [new file with mode: 0644]
support/testing/tests/package/sample_python_rsa.py [new file with mode: 0644]
support/testing/tests/package/test_python_rsa.py [new file with mode: 0644]

index 5c663628b635b1a1c2bc08f250a485af15ed3eb8..8bf15686a7b19e980cef6845e5643242d359450d 100644 (file)
@@ -2281,7 +2281,10 @@ F:       package/python-boto3/
 F:     package/python-botocore/
 F:     package/python-jmespath/
 F:     package/python-pymupdf/
+F:     package/python-rsa/
 F:     package/python-s3transfer/
+F:     support/testing/tests/package/sample_python_rsa.py
+F:     support/testing/tests/package/test_python_rsa.py
 
 N:     Refik Tuzakli <tuzakli.refik@gmail.com>
 F:     package/freescale-imx/
index 046c04e99484ba882bf5396b41bd7f1f2f3606bf..1b9a960bf7b76b0e27cd229629b0c434fdab44cd 100644 (file)
@@ -1184,6 +1184,7 @@ menu "External python modules"
        source "package/python-requests-toolbelt/Config.in"
        source "package/python-rpi-gpio/Config.in"
        source "package/python-rpi-ws281x/Config.in"
+       source "package/python-rsa/Config.in"
        source "package/python-rtslib-fb/Config.in"
        source "package/python-s3transfer/Config.in"
        source "package/python-scandir/Config.in"
diff --git a/package/python-rsa/Config.in b/package/python-rsa/Config.in
new file mode 100644 (file)
index 0000000..bc9ec2f
--- /dev/null
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PYTHON_RSA
+       bool "python-rsa"
+       depends on BR2_PACKAGE_PYTHON3
+       select BR2_PACKAGE_PYTHON_PYASN1 # runtime
+       help
+         Python-RSA is a pure-Python RSA implementation. It supports
+         encryption and decryption, signing and verifying signatures,
+         and key generation according to PKCS\#1 version 1.5. It can
+         be used as a Python library as well as on the command line.
+
+         https://stuvel.eu/rsa
diff --git a/package/python-rsa/python-rsa.hash b/package/python-rsa/python-rsa.hash
new file mode 100644 (file)
index 0000000..9fbbf0a
--- /dev/null
@@ -0,0 +1,5 @@
+# From https://pypi.org/project/rsa/
+sha256  9d689e6ca1b3038bc82bf8d23e944b6b6037bc02301a574935b2dd946e0353b9  rsa-4.7.2.tar.gz
+
+# Locally computed
+sha256 073f28b7d389c8fe74f607e17c27f81eaa5ace69edc43a884f23f41b41c5c726  LICENSE
diff --git a/package/python-rsa/python-rsa.mk b/package/python-rsa/python-rsa.mk
new file mode 100644 (file)
index 0000000..eaa47e8
--- /dev/null
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-rsa
+#
+################################################################################
+
+PYTHON_RSA_VERSION = 4.7.2
+PYTHON_RSA_SOURCE = rsa-$(PYTHON_RSA_VERSION).tar.gz
+PYTHON_RSA_SITE = https://files.pythonhosted.org/packages/db/b5/475c45a58650b0580421746504b680cd2db4e81bc941e94ca53785250269
+PYTHON_RSA_SETUP_TYPE = setuptools
+PYTHON_RSA_LICENSE = Apache-2.0
+PYTHON_RSA_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
diff --git a/support/testing/tests/package/sample_python_rsa.py b/support/testing/tests/package/sample_python_rsa.py
new file mode 100644 (file)
index 0000000..6f246f4
--- /dev/null
@@ -0,0 +1,2 @@
+import rsa
+(pubkey, privkey) = rsa.newkeys(512)
diff --git a/support/testing/tests/package/test_python_rsa.py b/support/testing/tests/package/test_python_rsa.py
new file mode 100644 (file)
index 0000000..e63d63e
--- /dev/null
@@ -0,0 +1,11 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3RSA(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_RSA=y
+        """
+    sample_scripts = ["tests/package/sample_python_rsa.py"]