Получить нулевое значение при получении ключа из хранилища ключей при вызове функции getEntry? - PullRequest
0 голосов
/ 21 марта 2020
ProtectionParameter protectionParam = new KeyStore.PasswordProtection(keyPassword);System.out.println(protectionParam);

SecretKeyEntry secretKeyEnt = null;

SecretKey secretKey = null;

try {

    secretKeyEnt = (SecretKeyEntry) keyStore.getEntry(SECRETKEYALIAS, protectionParam);
    System.out.println(secretKeyEnt);
    secretKey = ((SecretKeyEntry) secretKeyEnt).getSecretKey();
    } 
catch (NoSuchAlgorithmException | UnrecoverableEntryException | KeyStoreException e) {
        LOGGER.error("error in getting the secret key|" + e);
...