Java Code Examples for org.witness.proofmode.crypto.PgpUtils#getInstance()

The following examples show how to use org.witness.proofmode.crypto.PgpUtils#getInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java    From proofmode with GNU General Public License v3.0 6 votes vote down vote up
private void publishKey ()
{

    try {
        if (mPgpUtils == null)
            mPgpUtils = PgpUtils.getInstance(this,mPrefs.getString("password",PgpUtils.DEFAULT_PASSWORD));

        mPgpUtils.publishPublicKey();
        String fingerprint = mPgpUtils.getPublicKeyFingerprint();

        Toast.makeText(this, R.string.open_public_key_page, Toast.LENGTH_LONG).show();

        openUrl(PgpUtils.URL_LOOKUP_ENDPOINT + fingerprint);
    }
    catch (IOException ioe)
    {
        Log.e("Proofmode","error publishing key",ioe);
    }
}
 
Example 2
Source File: MainActivity.java    From proofmode with GNU General Public License v3.0 6 votes vote down vote up
private void shareKey ()
{


    try {

        if (mPgpUtils == null)
            mPgpUtils = PgpUtils.getInstance(this,mPrefs.getString("password",PgpUtils.DEFAULT_PASSWORD));

        mPgpUtils.publishPublicKey();
        String pubKey = mPgpUtils.getPublicKey();

        Intent intent = new Intent(Intent.ACTION_SEND);
        intent.setType("text/plain");
        intent.putExtra(Intent.EXTRA_TEXT,pubKey);
        startActivity(intent);
    }
    catch (IOException ioe)
    {
        Log.e("Proofmode","error publishing key",ioe);
    }
}