neuhalje/bouncy-gpg

BouncyGPG.registerProvider() method not found

cincarnato opened this issue · 1 comments

I add bouncy-gpg 2.1.2 as a dependency (Maven).

I follow the examples,, but the method registerProvider in BouncyGPG doesn't exist.

Hi @cincarnato ,

it seems I added this after 2.1.2 . Just use the following code:

  /**
   * <p>Register the BouncyCastle provider as first provider. If another instance of the
   * BouncyCastle provider is already registered it is removed.
   * </p>
   * <p>The BouncyCastle provider needs to be registered for BouncyGPG to work.</p>
   * <p>
   * This procedure also makes it possible to use BC on older Android devices that ship their own BC
   * implementation.
   * </p>
   */
  public synchronized static void registerProvider() {
    Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
    Security.insertProviderAt(new BouncyCastleProvider(), 0);
  }