Class BCUtil


  • public final class BCUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int getBitStrength​(org.bouncycastle.openpgp.PGPPublicKey key)
      Utility method to get the bit strength of OpenPGP keys.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getBitStrength

        public static int getBitStrength​(org.bouncycastle.openpgp.PGPPublicKey key)
                                  throws java.security.NoSuchAlgorithmException
        Utility method to get the bit strength of OpenPGP keys. Bouncycastle is lacking support for some keys (eg. EdDSA, X25519), so this method manually derives the bit strength from the keys curves OID.
        Parameters:
        key - key
        Returns:
        bit strength
        Throws:
        java.security.NoSuchAlgorithmException