summaryrefslogtreecommitdiff
path: root/python-pyjwe.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-pyjwe.spec')
-rw-r--r--python-pyjwe.spec204
1 files changed, 204 insertions, 0 deletions
diff --git a/python-pyjwe.spec b/python-pyjwe.spec
new file mode 100644
index 0000000..9ef727b
--- /dev/null
+++ b/python-pyjwe.spec
@@ -0,0 +1,204 @@
+%global _empty_manifest_terminate_build 0
+Name: python-PyJWE
+Version: 1.0.0
+Release: 1
+Summary: JSON Web Encryption implementation in Python
+License: MIT
+URL: http://github.com/chrisseto/pyjwe
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/59/f9/9d8f24fdcae49fcb18607bdde460fdfc80a55721b86014d0c2fb617ee8b2/PyJWE-1.0.0.tar.gz
+BuildArch: noarch
+
+
+%description
+# PyJWE
+[JSON Web Encryption](https://tools.ietf.org/html/rfc7516) implementation in Python
+
+[![PyPI version](https://badge.fury.io/py/PyJWE.svg)](https://badge.fury.io/py/PyJWE)
+[![Build Status](https://travis-ci.org/chrisseto/pyjwe.svg?branch=master)](https://travis-ci.org/chrisseto/pyjwe)
+
+
+## Basic Usage
+
+```python
+import jwe
+
+key = b'MySecretKey'
+salt = b'pepper'
+
+derived_key = jwe.kdf(key, salt)
+
+encoded = jwe.encrypt(b'SuperSecretData', derived_key)
+
+print(encoded)
+
+jwe.decrypt(encoded, derived_key) # b'SuperSecretData'
+```
+
+
+## FAQ
+
+### What is the kdf function? Should I use it? Do I have to use it?
+
+`jwe.kdf` is a very simple [key derivation function](https://en.wikipedia.org/wiki/Key_derivation_function) that uses the [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2).
+
+It is mostly there for the purpose of [key stretching](https://en.wikipedia.org/wiki/Key_stretching) so that users' keys do not have to be the perfect length for AES256.
+
+You do not have to use it, but if you do not your key must be exactly 256 bits.
+
+
+### Why is `dir` the only algorithm supported?
+
+Because [key wrapping](https://en.wikipedia.org/wiki/Key_Wrap) is more or less [completely useless](https://security.stackexchange.com/questions/40052/when-do-i-use-nist-aes-key-wrapping).
+
+
+### Why is AES 256 GCM the only encryption methd?
+
+It met my needs and I've yet to need another method.
+Feel free to submit an issue if you would like another method implemented.
+
+%package -n python3-PyJWE
+Summary: JSON Web Encryption implementation in Python
+Provides: python-PyJWE
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-PyJWE
+# PyJWE
+[JSON Web Encryption](https://tools.ietf.org/html/rfc7516) implementation in Python
+
+[![PyPI version](https://badge.fury.io/py/PyJWE.svg)](https://badge.fury.io/py/PyJWE)
+[![Build Status](https://travis-ci.org/chrisseto/pyjwe.svg?branch=master)](https://travis-ci.org/chrisseto/pyjwe)
+
+
+## Basic Usage
+
+```python
+import jwe
+
+key = b'MySecretKey'
+salt = b'pepper'
+
+derived_key = jwe.kdf(key, salt)
+
+encoded = jwe.encrypt(b'SuperSecretData', derived_key)
+
+print(encoded)
+
+jwe.decrypt(encoded, derived_key) # b'SuperSecretData'
+```
+
+
+## FAQ
+
+### What is the kdf function? Should I use it? Do I have to use it?
+
+`jwe.kdf` is a very simple [key derivation function](https://en.wikipedia.org/wiki/Key_derivation_function) that uses the [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2).
+
+It is mostly there for the purpose of [key stretching](https://en.wikipedia.org/wiki/Key_stretching) so that users' keys do not have to be the perfect length for AES256.
+
+You do not have to use it, but if you do not your key must be exactly 256 bits.
+
+
+### Why is `dir` the only algorithm supported?
+
+Because [key wrapping](https://en.wikipedia.org/wiki/Key_Wrap) is more or less [completely useless](https://security.stackexchange.com/questions/40052/when-do-i-use-nist-aes-key-wrapping).
+
+
+### Why is AES 256 GCM the only encryption methd?
+
+It met my needs and I've yet to need another method.
+Feel free to submit an issue if you would like another method implemented.
+
+%package help
+Summary: Development documents and examples for PyJWE
+Provides: python3-PyJWE-doc
+%description help
+# PyJWE
+[JSON Web Encryption](https://tools.ietf.org/html/rfc7516) implementation in Python
+
+[![PyPI version](https://badge.fury.io/py/PyJWE.svg)](https://badge.fury.io/py/PyJWE)
+[![Build Status](https://travis-ci.org/chrisseto/pyjwe.svg?branch=master)](https://travis-ci.org/chrisseto/pyjwe)
+
+
+## Basic Usage
+
+```python
+import jwe
+
+key = b'MySecretKey'
+salt = b'pepper'
+
+derived_key = jwe.kdf(key, salt)
+
+encoded = jwe.encrypt(b'SuperSecretData', derived_key)
+
+print(encoded)
+
+jwe.decrypt(encoded, derived_key) # b'SuperSecretData'
+```
+
+
+## FAQ
+
+### What is the kdf function? Should I use it? Do I have to use it?
+
+`jwe.kdf` is a very simple [key derivation function](https://en.wikipedia.org/wiki/Key_derivation_function) that uses the [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2).
+
+It is mostly there for the purpose of [key stretching](https://en.wikipedia.org/wiki/Key_stretching) so that users' keys do not have to be the perfect length for AES256.
+
+You do not have to use it, but if you do not your key must be exactly 256 bits.
+
+
+### Why is `dir` the only algorithm supported?
+
+Because [key wrapping](https://en.wikipedia.org/wiki/Key_Wrap) is more or less [completely useless](https://security.stackexchange.com/questions/40052/when-do-i-use-nist-aes-key-wrapping).
+
+
+### Why is AES 256 GCM the only encryption methd?
+
+It met my needs and I've yet to need another method.
+Feel free to submit an issue if you would like another method implemented.
+
+%prep
+%autosetup -n PyJWE-1.0.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-PyJWE -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 29 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.0-1
+- Package Spec generated