Ignore:
Timestamp:
04/16/19 16:06:37 (5 years ago)
Author:
bln4
Message:

You can now check for new mail while logged in (when you open the mail bay)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/auth/Actions.java

    r1316 r1320  
    1010import java.nio.file.StandardCopyOption;
    1111import java.security.InvalidKeyException;
     12import java.security.KeyFactory;
    1213import java.security.KeyPair;
    1314import java.security.KeyPairGenerator;
    1415import java.security.KeyStoreException;
    1516import java.security.NoSuchAlgorithmException;
     17import java.security.PrivateKey;
    1618import java.security.PublicKey;
    1719import java.security.SecureRandom;
    1820import java.security.cert.CertificateException;
    1921import java.security.spec.InvalidKeySpecException;
     22import java.security.spec.PKCS8EncodedKeySpec;
    2023import java.sql.SQLException;
    2124import java.text.ParseException;
     
    109112         * @throws KeyStoreException
    110113         * @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 {
    113121                if (!AuthenticatorBrowser.isAuthenticated()) return;
    114122                if (!DisplayController.isMailMode()) {
    115123                        MailBay.ensureLink();
    116124                        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);
    118129                }
    119130                DisplayController.ToggleMailMode();
Note: See TracChangeset for help on using the changeset viewer.