getSigningPgpKey :: PSState -> DBus.MethodHandlerT IO KeyID
getSigningPgpKey st = do
    pIdent <- (runPSM st $ getSigningKey) >>= \case
        Just pi -> return pi
        Nothing -> do
            DBus.methodError $
                   MsgError{ errorName = "org.pontarius.Error.Sign"
                           , errorText = Just "No signing key found"
                           , errorBody = []
                           }
    case privIdentKeyBackend pIdent of
        "gpg" -> return $ privIdentKeyID pIdent
        backend -> DBus.methodError $
             MsgError { errorName = "org.pontarius.Error.Sign"
                      , errorText = Just $ "Unknown key backend " <> backend
                      , errorBody = []
                      }
getSigningPgpKey :: PSState -> DBus.MethodHandlerT IO KeyID
getSigningPgpKey st = do
    pIdent <- (runPSM st $ getSigningKey) >>= \case
        Just pi -> return pi
        Nothing -> do
            DBus.methodError $
                   MsgError{ errorName = "org.pontarius.Error.Sign"
                           , errorText = Just "No signing key found"
                           , errorBody = []
                           }
    case privIdentKeyBackend pIdent of
        "gpg" -> return $ privIdentKeyID pIdent
        backend -> DBus.methodError $
             MsgError { errorName = "org.pontarius.Error.Sign"
                      , errorText = Just $ "Unknown key backend " <> backend
                      , errorBody = []
                      }
getSigningPgpKey st = do
    pIdent <- (runPSM st $ getSigningKey) >>= \case
        Just pi -> return pi
        Nothing -> do
            DBus.methodError $
                   MsgError{ errorName = "org.pontarius.Error.Sign"
                           , errorText = Just "No signing key found"
                           , errorBody = []
                           }
    case privIdentKeyBackend pIdent of
        "gpg" -> return $ privIdentKeyID pIdent
        backend -> DBus.methodError $
             MsgError { errorName = "org.pontarius.Error.Sign"
                      , errorText = Just $ "Unknown key backend " <> backend
                      , errorBody = []
                      }