Changeset 5afa32a


Ignore:
Timestamp:
Apr 24, 2019 12:23:35 PM (15 months ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
baeaa65
Parents:
ca0f127
Message:

Crypto: Catch ProviderException? in KeyStoreUtil? (ticket #2479)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/crypto/KeyStoreUtil.java

    rca0f127 r5afa32a  
    1212import java.security.MessageDigest;
    1313import java.security.PrivateKey;
     14import java.security.ProviderException;
    1415import java.security.PublicKey;
    1516import java.security.cert.Certificate;
     
    10201021            char[] keypwchars = keyPW.toCharArray();
    10211022            return (PrivateKey) keyStore.getKey(alias, keypwchars);
     1023        } catch (ProviderException pe) {
     1024            // PE is unchecked
     1025            throw new GeneralSecurityException(pe);
    10221026        } finally {
    10231027            if (fis != null) try { fis.close(); } catch (IOException ioe) {}
     
    10501054            Certificate[] certs = keyStore.getCertificateChain(alias);
    10511055            CertUtil.exportPrivateKey(pk, certs, out);
     1056        } catch (ProviderException pe) {
     1057            // PE is unchecked
     1058            throw new GeneralSecurityException(pe);
    10521059        } finally {
    10531060            if (fis != null) try { fis.close(); } catch (IOException ioe) {}
     
    11021109            keyStore.store(fos, pwchars);
    11031110            return cert;
     1111        } catch (ProviderException pe) {
     1112            // PE is unchecked
     1113            throw new GeneralSecurityException(pe);
    11041114        } finally {
    11051115            if (fis != null) try { fis.close(); } catch (IOException ioe) {}
     
    11421152            keyStore.store(fos, pwchars);
    11431153            return alias;
     1154        } catch (ProviderException pe) {
     1155            // PE is unchecked
     1156            throw new GeneralSecurityException(pe);
    11441157        } finally {
    11451158            if (fos != null) try { fos.close(); } catch (IOException ioe) {}
     
    11701183            fos = new SecureFileOutputStream(ks);
    11711184            keyStore.store(fos, pwchars);
     1185        } catch (ProviderException pe) {
     1186            // PE is unchecked
     1187            throw new GeneralSecurityException(pe);
    11721188        } finally {
    11731189            if (fos != null) try { fos.close(); } catch (IOException ioe) {}
Note: See TracChangeset for help on using the changeset viewer.