Changeset 1244 for trunk/src/org/expeditee/auth/Authenticator.java
- Timestamp:
- 03/17/19 22:29:23 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/auth/Authenticator.java
r1243 r1244 180 180 } 181 181 182 final SecretKey getSecretKey(final String label, final String password) throws NoSuchAlgorithmException, KeyStoreException { 183 final KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(password.toCharArray()); 184 KeyStore.SecretKeyEntry entry = null; 182 final SecretKey getSecretKey(final String label, final String password) throws NoSuchAlgorithmException, KeyStoreException { 183 184 char[] password_ca = password.toCharArray(); 185 final KeyStore.ProtectionParameter entryPassword = new KeyStore.PasswordProtection(password_ca); 186 187 SecretKey secret_key; 185 188 try { 186 entry = (SecretKeyEntry) keyStore.getEntry(label, entryPassword); 189 SecretKeyEntry entry = (SecretKeyEntry) keyStore.getEntry(label, entryPassword); 190 secret_key = entry.getSecretKey(); 191 187 192 } catch (final UnrecoverableEntryException e) { 188 entry = null;189 } 190 if (entry == null) { return null; }191 else { return entry.getSecretKey(); }193 secret_key = null; 194 } 195 196 return secret_key; 192 197 } 193 198
Note:
See TracChangeset
for help on using the changeset viewer.