Missing licence error for a product i dont need

2 Ansichten (letzte 30 Tage)
Benedikt L
Benedikt L am 15 Mär. 2019
Kommentiert: Benedikt L am 18 Mär. 2019
Hello,
I'm using R2017b, Output of ver:
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.3.0.713579 (R2017b)
MATLAB License Number: xxxxxxxxxxx
Operating System: Microsoft Windows 7 Enterprise Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.3 (R2017b)
Simulink Version 9.0 (R2017b)
I want to use some of the RSA capabilities of Java for a MATLAB project.
This is my code:
keygen = java.security.KeyPairGenerator.getInstance("RSA");
keygen.initialize(2048);
key = keygen.generateKeyPair;
cipher = javax.crypto.Cipher.getInstance('RSA');
cipher.init(cipher.ENCRYPT_MODE, key);
This code gives me the following error output:
To use 'init', at least one of the following products must be licensed, installed, and enabled:
Neural Network Toolbox
System Identification Toolbox
Error in Untitled (line 6)
cipher.init(cipher.ENCRYPT_MODE, key);
I don't think that I need this kind of Toolboxes for this Java-RSA functionality. Is it a bug? How can I fix it?
Best regards
Benedikt

Akzeptierte Antwort

Andreas Goser
Andreas Goser am 18 Mär. 2019
Bearbeitet: Andreas Goser am 18 Mär. 2019
Not knowing what the code actually does, I can the following error:
cipher.init(cipher.ENCRYPT_MODE, key);
No method 'init' with matching signature found for class 'javax.crypto.Cipher'.
And ecesuting "license('inuse')" after that only returns MATLAB. So your assumption might be true, those products are not needed, but it does not explain the different behaviour. Did you install any 3rd party toos? Anything that modifies search paths or shadows existing functionality? You may want to try:
rehash toolboxcache
restoredefaultpath
savepath
  1 Kommentar
Benedikt L
Benedikt L am 18 Mär. 2019
Thank you Andreas, your answer showed me the right track.
The root of the problem was in the argument type of the java function. Sadly it was hard to find the problem due to the misleading error message.
Best regards
Benedikt

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Produkte


Version

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by