Add key usage with encryption #1212
danidopi27
started this conversation in
General
Replies: 1 comment 5 replies
-
one question! is it somewhere described in opc ua reference/spec.? so is it a missing feature or just an diy custom solution? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I´ve been working these days with a OPCUA prosys server and I wanted to use a key which is encrypted with a password.
In order to be able to do that, I modifed the client.py, creating a new method called set_security_params (very similar to set_security_string) and modifying set_security function, and also I needed to modify uacrypto.py (adding to load_private_key function the password).
I don´t know if it is the best way to do it but it works (at least with the tests I did). So I want to share this changes in order that it could help someone else or to improve this library if these changes are approved for the developers.
The changes are the following:
In client.py (create the new function set_security_params and adding the password as parameter of set_security and use it in pk definition:
In uacrypto.py (add to load_private_key function the possibility of having a password for the key):
In main.py (how to set the security):
client.set_security_params("Basic256Sha256", "Sign", "certs/Python/pythonCert.der", "certs/Python/pythonKey.pem", "python")
I hope this will help someone that have my initial problems :)
Beta Was this translation helpful? Give feedback.
All reactions