The current code checks the KeyFlags subpacket to determine if a key can be used to encrypt/sign.
However if the key doesn't have a KeyFlags subpacket Bouncy-GPG refuses to use it to encrypt/sign, whereas GPG has a fallback scenario where it analyses the key's algorithm to determine its role.
We implemented the same fallback scenario here, using the key algorithm if it doesn't have a KeyFlags subpacket.
The current code checks the KeyFlags subpacket to determine if a key can be used to encrypt/sign. However if the key doesn't have a KeyFlags subpacket Bouncy-GPG refuses to use it to encrypt/sign, whereas GPG has a fallback scenario where it analyses the key's algorithm to determine its role.
We implemented the same fallback scenario here, using the key algorithm if it doesn't have a KeyFlags subpacket.