Package org.pgpainless.util
Class BCUtil
- java.lang.Object
-
- org.pgpainless.util.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.
-
-
-
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
-
-