Class OpenPGPKeyException

java.lang.Object
java.lang.Throwable
java.lang.Exception
org.bouncycastle.openpgp.PGPException
org.bouncycastle.openpgp.api.exception.OpenPGPKeyException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InvalidEncryptionKeyException, InvalidSigningKeyException, KeyPassphraseException

public class OpenPGPKeyException extends PGPException
Exception representing an unusable or invalid OpenPGPKey or OpenPGPCertificate. Note: The term "key" is used to refer to both a certificate and a key.
See Also:
  • Constructor Details

    • OpenPGPKeyException

      public OpenPGPKeyException(OpenPGPCertificate key, String message)
      Something is wrong with a key or certificate in general (no particular subkey).
      Parameters:
      key - certificate or key
      message - message
    • OpenPGPKeyException

      public OpenPGPKeyException(OpenPGPCertificate.OpenPGPComponentKey componentKey, String message)
      Something is wrong with an individual component key of a key or certificate.
      Parameters:
      componentKey - component key
      message - message
  • Method Details

    • getKey

      public OpenPGPCertificate getKey()
      Return the problematic key or certificate.
      Returns:
      key or certificate
    • getComponentKey

      public OpenPGPCertificate.OpenPGPComponentKey getComponentKey()
      Return the problematic component key. Might be null, if the problem affects the entire key or certificate.
      Returns:
      component key