Changeset 1320 for trunk/src/org/expeditee/auth/Actions.java
- Timestamp:
- 04/16/19 16:06:37 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/auth/Actions.java
r1316 r1320 10 10 import java.nio.file.StandardCopyOption; 11 11 import java.security.InvalidKeyException; 12 import java.security.KeyFactory; 12 13 import java.security.KeyPair; 13 14 import java.security.KeyPairGenerator; 14 15 import java.security.KeyStoreException; 15 16 import java.security.NoSuchAlgorithmException; 17 import java.security.PrivateKey; 16 18 import java.security.PublicKey; 17 19 import java.security.SecureRandom; 18 20 import java.security.cert.CertificateException; 19 21 import java.security.spec.InvalidKeySpecException; 22 import java.security.spec.PKCS8EncodedKeySpec; 20 23 import java.sql.SQLException; 21 24 import java.text.ParseException; … … 109 112 * @throws KeyStoreException 110 113 * @throws ParseException 111 */ 112 public static void ToggleBay() throws KeyStoreException, FileNotFoundException, NoSuchAlgorithmException, CertificateException, ClassNotFoundException, SQLException, IOException, ParseException { 114 * @throws InvalidKeySpecException 115 * @throws BadPaddingException 116 * @throws IllegalBlockSizeException 117 * @throws NoSuchPaddingException 118 * @throws InvalidKeyException 119 */ 120 public static void ToggleBay() throws KeyStoreException, FileNotFoundException, NoSuchAlgorithmException, CertificateException, ClassNotFoundException, SQLException, IOException, ParseException, InvalidKeySpecException, InvalidKeyException, NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException { 113 121 if (!AuthenticatorBrowser.isAuthenticated()) return; 114 122 if (!DisplayController.isMailMode()) { 115 123 MailBay.ensureLink(); 116 124 Mail.clear(); 117 AuthenticatorBrowser.getInstance().loadMailDatabase(); 125 String keyEncoded = KeyList.PrivateKey.get().getData().get(0); 126 byte[] keyBytes = Base64.getDecoder().decode(keyEncoded); 127 PrivateKey key = KeyFactory.getInstance(AsymmetricAlgorithm).generatePrivate(new PKCS8EncodedKeySpec(keyBytes)); 128 Mail.checkMail(key); 118 129 } 119 130 DisplayController.ToggleMailMode();
Note:
See TracChangeset
for help on using the changeset viewer.