{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.OSTree.Interfaces.Sign
    ( 
#if defined(ENABLE_OVERLOADING)
    SignEd25519AddPkMethodInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519ClearKeysMethodInfo          ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519DataMethodInfo               ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519DataVerifyMethodInfo         ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519GetNameMethodInfo            ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519LoadPkMethodInfo             ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519MetadataFormatMethodInfo     ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519MetadataKeyMethodInfo        ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519SetPkMethodInfo              ,
#endif
#if defined(ENABLE_OVERLOADING)
    SignEd25519SetSkMethodInfo              ,
#endif

-- * Exported types
    Sign(..)                                ,
    IsSign                                  ,
    toSign                                  ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [addPk]("GI.OSTree.Interfaces.Sign#g:method:addPk"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [clearKeys]("GI.OSTree.Interfaces.Sign#g:method:clearKeys"), [commit]("GI.OSTree.Interfaces.Sign#g:method:commit"), [commitVerify]("GI.OSTree.Interfaces.Sign#g:method:commitVerify"), [data]("GI.OSTree.Interfaces.Sign#g:method:data"), [dataVerify]("GI.OSTree.Interfaces.Sign#g:method:dataVerify"), [ed25519AddPk]("GI.OSTree.Interfaces.Sign#g:method:ed25519AddPk"), [ed25519ClearKeys]("GI.OSTree.Interfaces.Sign#g:method:ed25519ClearKeys"), [ed25519Data]("GI.OSTree.Interfaces.Sign#g:method:ed25519Data"), [ed25519DataVerify]("GI.OSTree.Interfaces.Sign#g:method:ed25519DataVerify"), [ed25519GetName]("GI.OSTree.Interfaces.Sign#g:method:ed25519GetName"), [ed25519LoadPk]("GI.OSTree.Interfaces.Sign#g:method:ed25519LoadPk"), [ed25519MetadataFormat]("GI.OSTree.Interfaces.Sign#g:method:ed25519MetadataFormat"), [ed25519MetadataKey]("GI.OSTree.Interfaces.Sign#g:method:ed25519MetadataKey"), [ed25519SetPk]("GI.OSTree.Interfaces.Sign#g:method:ed25519SetPk"), [ed25519SetSk]("GI.OSTree.Interfaces.Sign#g:method:ed25519SetSk"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [loadPk]("GI.OSTree.Interfaces.Sign#g:method:loadPk"), [metadataFormat]("GI.OSTree.Interfaces.Sign#g:method:metadataFormat"), [metadataKey]("GI.OSTree.Interfaces.Sign#g:method:metadataKey"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [readPk]("GI.OSTree.Interfaces.Sign#g:method:readPk"), [readSk]("GI.OSTree.Interfaces.Sign#g:method:readSk"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [summary]("GI.OSTree.Interfaces.Sign#g:method:summary"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getName]("GI.OSTree.Interfaces.Sign#g:method:getName"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setPk]("GI.OSTree.Interfaces.Sign#g:method:setPk"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setSk]("GI.OSTree.Interfaces.Sign#g:method:setSk").

#if defined(ENABLE_OVERLOADING)
    ResolveSignMethod                       ,
#endif

-- ** addPk #method:addPk#

#if defined(ENABLE_OVERLOADING)
    SignAddPkMethodInfo                     ,
#endif
    signAddPk                               ,


-- ** clearKeys #method:clearKeys#

#if defined(ENABLE_OVERLOADING)
    SignClearKeysMethodInfo                 ,
#endif
    signClearKeys                           ,


-- ** commit #method:commit#

#if defined(ENABLE_OVERLOADING)
    SignCommitMethodInfo                    ,
#endif
    signCommit                              ,


-- ** commitVerify #method:commitVerify#

#if defined(ENABLE_OVERLOADING)
    SignCommitVerifyMethodInfo              ,
#endif
    signCommitVerify                        ,


-- ** data #method:data#

#if defined(ENABLE_OVERLOADING)
    SignDataMethodInfo                      ,
#endif
    signData                                ,


-- ** dataVerify #method:dataVerify#

#if defined(ENABLE_OVERLOADING)
    SignDataVerifyMethodInfo                ,
#endif
    signDataVerify                          ,


-- ** getAll #method:getAll#

    signGetAll                              ,


-- ** getByName #method:getByName#

    signGetByName                           ,


-- ** getName #method:getName#

#if defined(ENABLE_OVERLOADING)
    SignGetNameMethodInfo                   ,
#endif
    signGetName                             ,


-- ** loadPk #method:loadPk#

#if defined(ENABLE_OVERLOADING)
    SignLoadPkMethodInfo                    ,
#endif
    signLoadPk                              ,


-- ** metadataFormat #method:metadataFormat#

#if defined(ENABLE_OVERLOADING)
    SignMetadataFormatMethodInfo            ,
#endif
    signMetadataFormat                      ,


-- ** metadataKey #method:metadataKey#

#if defined(ENABLE_OVERLOADING)
    SignMetadataKeyMethodInfo               ,
#endif
    signMetadataKey                         ,


-- ** readPk #method:readPk#

#if defined(ENABLE_OVERLOADING)
    SignReadPkMethodInfo                    ,
#endif
    signReadPk                              ,


-- ** readSk #method:readSk#

#if defined(ENABLE_OVERLOADING)
    SignReadSkMethodInfo                    ,
#endif
    signReadSk                              ,


-- ** setPk #method:setPk#

#if defined(ENABLE_OVERLOADING)
    SignSetPkMethodInfo                     ,
#endif
    signSetPk                               ,


-- ** setSk #method:setSk#

#if defined(ENABLE_OVERLOADING)
    SignSetSkMethodInfo                     ,
#endif
    signSetSk                               ,


-- ** summary #method:summary#

#if defined(ENABLE_OVERLOADING)
    SignSummaryMethodInfo                   ,
#endif
    signSummary                             ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GLib.Structs.VariantDict as GLib.VariantDict
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.OSTree.Callbacks as OSTree.Callbacks
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.BlobReader as OSTree.BlobReader
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.ContentWriter as OSTree.ContentWriter
import {-# SOURCE #-} qualified GI.OSTree.Objects.GpgVerifyResult as OSTree.GpgVerifyResult
import {-# SOURCE #-} qualified GI.OSTree.Objects.MutableTree as OSTree.MutableTree
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
import {-# SOURCE #-} qualified GI.OSTree.Objects.RepoFile as OSTree.RepoFile
import {-# SOURCE #-} qualified GI.OSTree.Objects.SePolicy as OSTree.SePolicy
import {-# SOURCE #-} qualified GI.OSTree.Structs.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCheckoutAtOptions as OSTree.RepoCheckoutAtOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCommitModifier as OSTree.RepoCommitModifier
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoDevInoCache as OSTree.RepoDevInoCache
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoFinderResult as OSTree.RepoFinderResult
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoPruneOptions as OSTree.RepoPruneOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoTransactionStats as OSTree.RepoTransactionStats

#else
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.BlobReader as OSTree.BlobReader
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo

#endif

-- interface Sign 
-- | Memory-managed wrapper type.
newtype Sign = Sign (SP.ManagedPtr Sign)
    deriving (Sign -> Sign -> Bool
(Sign -> Sign -> Bool) -> (Sign -> Sign -> Bool) -> Eq Sign
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Sign -> Sign -> Bool
== :: Sign -> Sign -> Bool
$c/= :: Sign -> Sign -> Bool
/= :: Sign -> Sign -> Bool
Eq)

instance SP.ManagedPtrNewtype Sign where
    toManagedPtr :: Sign -> ManagedPtr Sign
toManagedPtr (Sign ManagedPtr Sign
p) = ManagedPtr Sign
p

foreign import ccall "ostree_sign_get_type"
    c_ostree_sign_get_type :: IO B.Types.GType

instance B.Types.TypedObject Sign where
    glibType :: IO GType
glibType = IO GType
c_ostree_sign_get_type

instance B.Types.GObject Sign

-- | Type class for types which can be safely cast to t'Sign', for instance with `toSign`.
class (SP.GObject o, O.IsDescendantOf Sign o) => IsSign o
instance (SP.GObject o, O.IsDescendantOf Sign o) => IsSign o

instance O.HasParentTypes Sign
type instance O.ParentTypes Sign = '[GObject.Object.Object]

-- | Cast to t'Sign', for types for which this is known to be safe. For general casts, use 'Data.GI.Base.ManagedPtr.castTo'.
toSign :: (MIO.MonadIO m, IsSign o) => o -> m Sign
toSign :: forall (m :: * -> *) o. (MonadIO m, IsSign o) => o -> m Sign
toSign = IO Sign -> m Sign
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Sign -> m Sign) -> (o -> IO Sign) -> o -> m Sign
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Sign -> Sign) -> o -> IO Sign
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Sign -> Sign
Sign

-- | Convert t'Sign' to and from t'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe Sign) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_sign_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Sign -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Sign
P.Nothing = Ptr GValue -> Ptr Sign -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Sign
forall a. Ptr a
FP.nullPtr :: FP.Ptr Sign)
    gvalueSet_ Ptr GValue
gv (P.Just Sign
obj) = Sign -> (Ptr Sign -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Sign
obj (Ptr GValue -> Ptr Sign -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Sign)
gvalueGet_ Ptr GValue
gv = do
        ptr <- Ptr GValue -> IO (Ptr Sign)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Sign)
        if ptr /= FP.nullPtr
        then P.Just <$> B.ManagedPtr.newObject Sign ptr
        else return P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Sign
type instance O.AttributeList Sign = SignAttributeList
type SignAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSignMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSignMethod "addPk" o = SignAddPkMethodInfo
    ResolveSignMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSignMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSignMethod "clearKeys" o = SignClearKeysMethodInfo
    ResolveSignMethod "commit" o = SignCommitMethodInfo
    ResolveSignMethod "commitVerify" o = SignCommitVerifyMethodInfo
    ResolveSignMethod "data" o = SignDataMethodInfo
    ResolveSignMethod "dataVerify" o = SignDataVerifyMethodInfo
    ResolveSignMethod "ed25519AddPk" o = SignEd25519AddPkMethodInfo
    ResolveSignMethod "ed25519ClearKeys" o = SignEd25519ClearKeysMethodInfo
    ResolveSignMethod "ed25519Data" o = SignEd25519DataMethodInfo
    ResolveSignMethod "ed25519DataVerify" o = SignEd25519DataVerifyMethodInfo
    ResolveSignMethod "ed25519GetName" o = SignEd25519GetNameMethodInfo
    ResolveSignMethod "ed25519LoadPk" o = SignEd25519LoadPkMethodInfo
    ResolveSignMethod "ed25519MetadataFormat" o = SignEd25519MetadataFormatMethodInfo
    ResolveSignMethod "ed25519MetadataKey" o = SignEd25519MetadataKeyMethodInfo
    ResolveSignMethod "ed25519SetPk" o = SignEd25519SetPkMethodInfo
    ResolveSignMethod "ed25519SetSk" o = SignEd25519SetSkMethodInfo
    ResolveSignMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSignMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSignMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSignMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSignMethod "loadPk" o = SignLoadPkMethodInfo
    ResolveSignMethod "metadataFormat" o = SignMetadataFormatMethodInfo
    ResolveSignMethod "metadataKey" o = SignMetadataKeyMethodInfo
    ResolveSignMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSignMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSignMethod "readPk" o = SignReadPkMethodInfo
    ResolveSignMethod "readSk" o = SignReadSkMethodInfo
    ResolveSignMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSignMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSignMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSignMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSignMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSignMethod "summary" o = SignSummaryMethodInfo
    ResolveSignMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSignMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSignMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSignMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSignMethod "getName" o = SignGetNameMethodInfo
    ResolveSignMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSignMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSignMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSignMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSignMethod "setPk" o = SignSetPkMethodInfo
    ResolveSignMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSignMethod "setSk" o = SignSetSkMethodInfo
    ResolveSignMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveSignMethod t Sign, O.OverloadedMethod info Sign p) => OL.IsLabel t (Sign -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveSignMethod t Sign, O.OverloadedMethod info Sign p, R.HasField t Sign p) => R.HasField t Sign p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveSignMethod t Sign, O.OverloadedMethodInfo info Sign) => OL.IsLabel t (O.MethodProxy info Sign) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

-- method Sign::add_pk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "public_key"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "single public key to be added"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_add_pk" ostree_sign_add_pk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GVariant ->                         -- public_key : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Add the public key for verification. Could be called multiple times for
-- adding all needed keys to be used for verification.
-- 
-- The /@publicKey@/ argument depends of the particular engine implementation.
-- 
-- /Since: 2020.2/
signAddPk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GVariant
    -- ^ /@publicKey@/: single public key to be added
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signAddPk :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> GVariant -> m ()
signAddPk a
self GVariant
publicKey = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    publicKey' <- unsafeManagedPtrGetPtr publicKey
    onException (do
        _ <- propagateGError $ ostree_sign_add_pk self' publicKey'
        touchManagedPtr self
        touchManagedPtr publicKey
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignAddPkMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignAddPkMethodInfo a signature where
    overloadedMethod = signAddPk

instance O.OverloadedMethodInfo SignAddPkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signAddPk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signAddPk"
        })


#endif

-- method Sign::clear_keys
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_clear_keys" ostree_sign_clear_keys :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Clear all previously preloaded secret and public keys.
-- 
-- /Since: 2020.2/
signClearKeys ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signClearKeys :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> m ()
signClearKeys a
self = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    onException (do
        _ <- propagateGError $ ostree_sign_clear_keys self'
        touchManagedPtr self
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignClearKeysMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignClearKeysMethodInfo a signature where
    overloadedMethod = signClearKeys

instance O.OverloadedMethodInfo SignClearKeysMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signClearKeys",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signClearKeys"
        })


#endif

-- method Sign::commit
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OsreeRepo object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "SHA256 of given commit to sign"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_commit" ostree_sign_commit :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr OSTree.Repo.Repo ->                 -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit_checksum : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Add a signature to a commit.
-- 
-- Depending of the signing engine used you will need to load
-- the secret key with @/ostree_sign_set_sk/@.
-- 
-- /Since: 2020.2/
signCommit ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> b
    -- ^ /@repo@/: an @/OsreeRepo/@ object
    -> T.Text
    -- ^ /@commitChecksum@/: SHA256 of given commit to sign
    -> Maybe (c)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signCommit :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSign a, IsRepo b, IsCancellable c) =>
a -> b -> Text -> Maybe c -> m ()
signCommit a
self b
repo Text
commitChecksum Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    repo' <- unsafeManagedPtrCastPtr repo
    commitChecksum' <- textToCString commitChecksum
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_sign_commit self' repo' commitChecksum' maybeCancellable
        touchManagedPtr self
        touchManagedPtr repo
        whenJust cancellable touchManagedPtr
        freeMem commitChecksum'
        return ()
     ) (do
        freeMem commitChecksum'
     )

#if defined(ENABLE_OVERLOADING)
data SignCommitMethodInfo
instance (signature ~ (b -> T.Text -> Maybe (c) -> m ()), MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SignCommitMethodInfo a signature where
    overloadedMethod = signCommit

instance O.OverloadedMethodInfo SignCommitMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signCommit",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signCommit"
        })


#endif

-- method Sign::commit_verify
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OsreeRepo object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "commit_checksum"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "SHA256 of given commit to verify"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_success_message"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "success message returned by the signing\nengine"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_commit_verify" ostree_sign_commit_verify :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr OSTree.Repo.Repo ->                 -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    CString ->                              -- commit_checksum : TBasicType TUTF8
    Ptr CString ->                          -- out_success_message : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Verify if commit is signed with known key.
-- 
-- Depending of the signing engine used you will need to load
-- the public key(s) for verification with @/ostree_sign_set_pk/@,
-- @/ostree_sign_add_pk/@ and\/or @/ostree_sign_load_pk/@.
-- 
-- /Since: 2020.2/
signCommitVerify ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> b
    -- ^ /@repo@/: an @/OsreeRepo/@ object
    -> T.Text
    -- ^ /@commitChecksum@/: SHA256 of given commit to verify
    -> Maybe (c)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signCommitVerify :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSign a, IsRepo b, IsCancellable c) =>
a -> b -> Text -> Maybe c -> m (Maybe Text)
signCommitVerify a
self b
repo Text
commitChecksum Maybe c
cancellable = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    repo' <- unsafeManagedPtrCastPtr repo
    commitChecksum' <- textToCString commitChecksum
    outSuccessMessage <- callocMem :: IO (Ptr CString)
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_sign_commit_verify self' repo' commitChecksum' outSuccessMessage maybeCancellable
        outSuccessMessage' <- peek outSuccessMessage
        maybeOutSuccessMessage' <- convertIfNonNull outSuccessMessage' $ \CString
outSuccessMessage'' -> do
            outSuccessMessage''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outSuccessMessage''
            return outSuccessMessage'''
        freeMem outSuccessMessage'
        touchManagedPtr self
        touchManagedPtr repo
        whenJust cancellable touchManagedPtr
        freeMem commitChecksum'
        freeMem outSuccessMessage
        return maybeOutSuccessMessage'
     ) (do
        freeMem commitChecksum'
        freeMem outSuccessMessage
     )

#if defined(ENABLE_OVERLOADING)
data SignCommitVerifyMethodInfo
instance (signature ~ (b -> T.Text -> Maybe (c) -> m ((Maybe T.Text))), MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SignCommitVerifyMethodInfo a signature where
    overloadedMethod = signCommitVerify

instance O.OverloadedMethodInfo SignCommitVerifyMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signCommitVerify",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signCommitVerify"
        })


#endif

-- method Sign::data
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the raw data to be signed with pre-loaded secret key"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signature"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "in case of success will contain signature"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_data" ostree_sign_data :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GLib.Bytes.Bytes ->                 -- data : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr (Ptr GLib.Bytes.Bytes) ->           -- signature : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Sign the given /@data@/ with pre-loaded secret key.
-- 
-- Depending of the signing engine used you will need to load
-- the secret key with @/ostree_sign_set_sk/@.
-- 
-- /Since: 2020.2/
signData ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GLib.Bytes.Bytes
    -- ^ /@data@/: the raw data to be signed with pre-loaded secret key
    -> Maybe (b)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m (GLib.Bytes.Bytes)
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signData :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSign a, IsCancellable b) =>
a -> Bytes -> Maybe b -> m Bytes
signData a
self Bytes
data_ Maybe b
cancellable = IO Bytes -> m Bytes
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bytes -> m Bytes) -> IO Bytes -> m Bytes
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    data_' <- unsafeManagedPtrGetPtr data_
    signature <- callocMem :: IO (Ptr (Ptr GLib.Bytes.Bytes))
    maybeCancellable <- case cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_sign_data self' data_' signature maybeCancellable
        signature' <- peek signature
        signature'' <- (wrapBoxed GLib.Bytes.Bytes) signature'
        touchManagedPtr self
        touchManagedPtr data_
        whenJust cancellable touchManagedPtr
        freeMem signature
        return signature''
     ) (do
        freeMem signature
     )

#if defined(ENABLE_OVERLOADING)
data SignDataMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> Maybe (b) -> m (GLib.Bytes.Bytes)), MonadIO m, IsSign a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod SignDataMethodInfo a signature where
    overloadedMethod = signData

instance O.OverloadedMethodInfo SignDataMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signData",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signData"
        })


#endif

-- method Sign::data_verify
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TInterface Name { namespace = "GLib" , name = "Bytes" }
--           , argCType = Just "GBytes*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the raw data to check"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "signatures"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the signatures to be checked"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "out_success_message"
--           , argType = TBasicType TUTF8
--           , argCType = Just "char**"
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "success message returned by the signing\nengine"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_data_verify" ostree_sign_data_verify :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GLib.Bytes.Bytes ->                 -- data : TInterface (Name {namespace = "GLib", name = "Bytes"})
    Ptr GVariant ->                         -- signatures : TVariant
    Ptr CString ->                          -- out_success_message : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Verify given data against signatures with pre-loaded public keys.
-- 
-- Depending of the signing engine used you will need to load
-- the public key(s) with @/ostree_sign_set_pk/@, @/ostree_sign_add_pk/@
-- or @/ostree_sign_load_pk/@.
-- 
-- /Since: 2020.2/
signDataVerify ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GLib.Bytes.Bytes
    -- ^ /@data@/: the raw data to check
    -> GVariant
    -- ^ /@signatures@/: the signatures to be checked
    -> m ((Maybe T.Text))
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signDataVerify :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> Bytes -> GVariant -> m (Maybe Text)
signDataVerify a
self Bytes
data_ GVariant
signatures = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    data_' <- unsafeManagedPtrGetPtr data_
    signatures' <- unsafeManagedPtrGetPtr signatures
    outSuccessMessage <- callocMem :: IO (Ptr CString)
    onException (do
        _ <- propagateGError $ ostree_sign_data_verify self' data_' signatures' outSuccessMessage
        outSuccessMessage' <- peek outSuccessMessage
        maybeOutSuccessMessage' <- convertIfNonNull outSuccessMessage' $ \CString
outSuccessMessage'' -> do
            outSuccessMessage''' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outSuccessMessage''
            return outSuccessMessage'''
        freeMem outSuccessMessage'
        touchManagedPtr self
        touchManagedPtr data_
        touchManagedPtr signatures
        freeMem outSuccessMessage
        return maybeOutSuccessMessage'
     ) (do
        freeMem outSuccessMessage
     )

#if defined(ENABLE_OVERLOADING)
data SignDataVerifyMethodInfo
instance (signature ~ (GLib.Bytes.Bytes -> GVariant -> m ((Maybe T.Text))), MonadIO m, IsSign a) => O.OverloadedMethod SignDataVerifyMethodInfo a signature where
    overloadedMethod = signDataVerify

instance O.OverloadedMethodInfo SignDataVerifyMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signDataVerify",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signDataVerify"
        })


#endif

-- XXX Could not generate method Sign::ed25519_add_pk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_add_pk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519AddPkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519AddPk" Sign) => O.OverloadedMethod SignEd25519AddPkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519AddPk" Sign) => O.OverloadedMethodInfo SignEd25519AddPkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_clear_keys
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_clear_keys” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519ClearKeysMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519ClearKeys" Sign) => O.OverloadedMethod SignEd25519ClearKeysMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519ClearKeys" Sign) => O.OverloadedMethodInfo SignEd25519ClearKeysMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_data
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_data” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519DataMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519Data" Sign) => O.OverloadedMethod SignEd25519DataMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519Data" Sign) => O.OverloadedMethodInfo SignEd25519DataMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_data_verify
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_data_verify” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519DataVerifyMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519DataVerify" Sign) => O.OverloadedMethod SignEd25519DataVerifyMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519DataVerify" Sign) => O.OverloadedMethodInfo SignEd25519DataVerifyMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_get_name
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_get_name” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519GetNameMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519GetName" Sign) => O.OverloadedMethod SignEd25519GetNameMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519GetName" Sign) => O.OverloadedMethodInfo SignEd25519GetNameMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_load_pk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_load_pk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519LoadPkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519LoadPk" Sign) => O.OverloadedMethod SignEd25519LoadPkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519LoadPk" Sign) => O.OverloadedMethodInfo SignEd25519LoadPkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_metadata_format
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_metadata_format” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519MetadataFormatMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519MetadataFormat" Sign) => O.OverloadedMethod SignEd25519MetadataFormatMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519MetadataFormat" Sign) => O.OverloadedMethodInfo SignEd25519MetadataFormatMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_metadata_key
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_metadata_key” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519MetadataKeyMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519MetadataKey" Sign) => O.OverloadedMethod SignEd25519MetadataKeyMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519MetadataKey" Sign) => O.OverloadedMethodInfo SignEd25519MetadataKeyMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_set_pk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_set_pk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519SetPkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519SetPk" Sign) => O.OverloadedMethod SignEd25519SetPkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519SetPk" Sign) => O.OverloadedMethodInfo SignEd25519SetPkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- XXX Could not generate method Sign::ed25519_set_sk
-- Bad introspection data: Could not resolve the symbol “ostree_sign_ed25519_set_sk” in the “OSTree” namespace, ignoring.
#if defined(ENABLE_OVERLOADING)
-- XXX: Dummy instance, since code generation failed.
-- Please file a bug at http://github.com/haskell-gi/haskell-gi.
data SignEd25519SetSkMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "ed25519SetSk" Sign) => O.OverloadedMethod SignEd25519SetSkMethodInfo o p where
    overloadedMethod = undefined

instance (o ~ O.UnsupportedMethodError "ed25519SetSk" Sign) => O.OverloadedMethodInfo SignEd25519SetSkMethodInfo o where
    overloadedMethodInfo = undefined

#endif

-- method Sign::get_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_sign_get_name" ostree_sign_get_name :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    IO CString

-- | Return the pointer to the name of currently used\/selected signing engine.
-- 
-- /Since: 2020.2/
signGetName ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> m T.Text
    -- ^ __Returns:__ pointer to the name
    -- /@nULL@/ in case of error (unlikely).
signGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> m Text
signGetName a
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_sign_get_name self'
    checkUnexpectedReturnNULL "signGetName" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SignGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSign a) => O.OverloadedMethod SignGetNameMethodInfo a signature where
    overloadedMethod = signGetName

instance O.OverloadedMethodInfo SignGetNameMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signGetName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signGetName"
        })


#endif

-- method Sign::load_pk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "any options" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_load_pk" ostree_sign_load_pk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GVariant ->                         -- options : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Load public keys for verification from anywhere.
-- It is expected that all keys would be added to already pre-loaded keys.
-- 
-- The /@options@/ argument depends of the particular engine implementation.
-- 
-- For example, /@ed25515@/ engine could use following string-formatted options:
-- * /@filename@/ -- single file to use to load keys from
-- * /@basedir@/ -- directory containing subdirectories
--   \'trusted.ed25519.d\' and \'revoked.ed25519.d\' with appropriate
--   public keys. Used for testing and re-definition of system-wide
--   directories if defaults are not suitable for any reason.
-- 
-- 
-- /Since: 2020.2/
signLoadPk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GVariant
    -- ^ /@options@/: any options
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signLoadPk :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> GVariant -> m ()
signLoadPk a
self GVariant
options = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    options' <- unsafeManagedPtrGetPtr options
    onException (do
        _ <- propagateGError $ ostree_sign_load_pk self' options'
        touchManagedPtr self
        touchManagedPtr options
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignLoadPkMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignLoadPkMethodInfo a signature where
    overloadedMethod = signLoadPk

instance O.OverloadedMethodInfo SignLoadPkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signLoadPk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signLoadPk"
        })


#endif

-- method Sign::metadata_format
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_sign_metadata_format" ostree_sign_metadata_format :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    IO CString

-- | Return the pointer to the string with format used in (detached) metadata for
-- current signing engine.
-- 
-- /Since: 2020.2/
signMetadataFormat ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> m T.Text
    -- ^ __Returns:__ pointer to the metadata format,
    -- /@nULL@/ in case of error (unlikely).
signMetadataFormat :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> m Text
signMetadataFormat a
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_sign_metadata_format self'
    checkUnexpectedReturnNULL "signMetadataFormat" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SignMetadataFormatMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSign a) => O.OverloadedMethod SignMetadataFormatMethodInfo a signature where
    overloadedMethod = signMetadataFormat

instance O.OverloadedMethodInfo SignMetadataFormatMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signMetadataFormat",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signMetadataFormat"
        })


#endif

-- method Sign::metadata_key
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "ostree_sign_metadata_key" ostree_sign_metadata_key :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    IO CString

-- | Return the pointer to the name of the key used in (detached) metadata for
-- current signing engine.
-- 
-- /Since: 2020.2/
signMetadataKey ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> m T.Text
    -- ^ __Returns:__ pointer to the metadata key name,
    -- /@nULL@/ in case of error (unlikely).
signMetadataKey :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> m Text
signMetadataKey a
self = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    result <- ostree_sign_metadata_key self'
    checkUnexpectedReturnNULL "signMetadataKey" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SignMetadataKeyMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSign a) => O.OverloadedMethod SignMetadataKeyMethodInfo a signature where
    overloadedMethod = signMetadataKey

instance O.OverloadedMethodInfo SignMetadataKeyMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signMetadataKey",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signMetadataKey"
        })


#endif

-- method Sign::read_pk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "stream"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "InputStream" }
--           , argCType = Just "GInputStream*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GInputStream" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "OSTree" , name = "BlobReader" })
-- throws : False
-- Skip return : False

foreign import ccall "ostree_sign_read_pk" ostree_sign_read_pk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr Gio.InputStream.InputStream ->      -- stream : TInterface (Name {namespace = "Gio", name = "InputStream"})
    IO (Ptr OSTree.BlobReader.BlobReader)

-- | Start reading public keys from a stream.
-- 
-- /Since: 2025.2/
signReadPk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, Gio.InputStream.IsInputStream b) =>
    a
    -- ^ /@self@/: Self
    -> b
    -- ^ /@stream@/: a t'GI.Gio.Objects.InputStream.InputStream'
    -> m OSTree.BlobReader.BlobReader
    -- ^ __Returns:__ a @/OstreamBlobReader/@ or 'P.Nothing' on error
signReadPk :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSign a, IsInputStream b) =>
a -> b -> m BlobReader
signReadPk a
self b
stream = IO BlobReader -> m BlobReader
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BlobReader -> m BlobReader) -> IO BlobReader -> m BlobReader
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    stream' <- unsafeManagedPtrCastPtr stream
    result <- ostree_sign_read_pk self' stream'
    checkUnexpectedReturnNULL "signReadPk" result
    result' <- (wrapObject OSTree.BlobReader.BlobReader) result
    touchManagedPtr self
    touchManagedPtr stream
    return result'

#if defined(ENABLE_OVERLOADING)
data SignReadPkMethodInfo
instance (signature ~ (b -> m OSTree.BlobReader.BlobReader), MonadIO m, IsSign a, Gio.InputStream.IsInputStream b) => O.OverloadedMethod SignReadPkMethodInfo a signature where
    overloadedMethod = signReadPk

instance O.OverloadedMethodInfo SignReadPkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signReadPk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signReadPk"
        })


#endif

-- method Sign::read_sk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "stream"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "InputStream" }
--           , argCType = Just "GInputStream*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GInputStream" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "OSTree" , name = "BlobReader" })
-- throws : False
-- Skip return : False

foreign import ccall "ostree_sign_read_sk" ostree_sign_read_sk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr Gio.InputStream.InputStream ->      -- stream : TInterface (Name {namespace = "Gio", name = "InputStream"})
    IO (Ptr OSTree.BlobReader.BlobReader)

-- | Start reading secret keys from a stream.
-- 
-- /Since: 2025.2/
signReadSk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, Gio.InputStream.IsInputStream b) =>
    a
    -- ^ /@self@/: Self
    -> b
    -- ^ /@stream@/: a t'GI.Gio.Objects.InputStream.InputStream'
    -> m OSTree.BlobReader.BlobReader
    -- ^ __Returns:__ a @/OstreamBlobReader/@ or 'P.Nothing' on error
signReadSk :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsSign a, IsInputStream b) =>
a -> b -> m BlobReader
signReadSk a
self b
stream = IO BlobReader -> m BlobReader
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BlobReader -> m BlobReader) -> IO BlobReader -> m BlobReader
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    stream' <- unsafeManagedPtrCastPtr stream
    result <- ostree_sign_read_sk self' stream'
    checkUnexpectedReturnNULL "signReadSk" result
    result' <- (wrapObject OSTree.BlobReader.BlobReader) result
    touchManagedPtr self
    touchManagedPtr stream
    return result'

#if defined(ENABLE_OVERLOADING)
data SignReadSkMethodInfo
instance (signature ~ (b -> m OSTree.BlobReader.BlobReader), MonadIO m, IsSign a, Gio.InputStream.IsInputStream b) => O.OverloadedMethod SignReadSkMethodInfo a signature where
    overloadedMethod = signReadSk

instance O.OverloadedMethodInfo SignReadSkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signReadSk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signReadSk"
        })


#endif

-- method Sign::set_pk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "public_key"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "single public key to be added"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_set_pk" ostree_sign_set_pk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GVariant ->                         -- public_key : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Set the public key for verification. It is expected what all
-- previously pre-loaded public keys will be dropped.
-- 
-- The /@publicKey@/ argument depends of the particular engine implementation.
-- 
-- /Since: 2020.2/
signSetPk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GVariant
    -- ^ /@publicKey@/: single public key to be added
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signSetPk :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> GVariant -> m ()
signSetPk a
self GVariant
publicKey = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    publicKey' <- unsafeManagedPtrGetPtr publicKey
    onException (do
        _ <- propagateGError $ ostree_sign_set_pk self' publicKey'
        touchManagedPtr self
        touchManagedPtr publicKey
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignSetPkMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignSetPkMethodInfo a signature where
    overloadedMethod = signSetPk

instance O.OverloadedMethodInfo SignSetPkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signSetPk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signSetPk"
        })


#endif

-- method Sign::set_sk
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "an #OstreeSign object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "secret_key"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "secret key to be added"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_set_sk" ostree_sign_set_sk :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr GVariant ->                         -- secret_key : TVariant
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Set the secret key to be used for signing data, commits and summary.
-- 
-- The /@secretKey@/ argument depends of the particular engine implementation.
-- 
-- /Since: 2020.2/
signSetSk ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a) =>
    a
    -- ^ /@self@/: an t'GI.OSTree.Interfaces.Sign.Sign' object
    -> GVariant
    -- ^ /@secretKey@/: secret key to be added
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signSetSk :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSign a) =>
a -> GVariant -> m ()
signSetSk a
self GVariant
secretKey = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    secretKey' <- unsafeManagedPtrGetPtr secretKey
    onException (do
        _ <- propagateGError $ ostree_sign_set_sk self' secretKey'
        touchManagedPtr self
        touchManagedPtr secretKey
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignSetSkMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsSign a) => O.OverloadedMethod SignSetSkMethodInfo a signature where
    overloadedMethod = signSetSk

instance O.OverloadedMethodInfo SignSetSkMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signSetSk",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signSetSk"
        })


#endif

-- method Sign::summary
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Sign" }
--           , argCType = Just "OstreeSign*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Just "Self" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "repo"
--           , argType =
--               TInterface Name { namespace = "OSTree" , name = "Repo" }
--           , argCType = Just "OstreeRepo*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "ostree repository" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "keys"
--           , argType = TVariant
--           , argCType = Just "GVariant*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "keys -- GVariant containing keys as GVarints specific to signature type."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GCancellable" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_summary" ostree_sign_summary :: 
    Ptr Sign ->                             -- self : TInterface (Name {namespace = "OSTree", name = "Sign"})
    Ptr OSTree.Repo.Repo ->                 -- repo : TInterface (Name {namespace = "OSTree", name = "Repo"})
    Ptr GVariant ->                         -- keys : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Add a signature to a summary file.
-- Based on ostree_repo_add_gpg_signature_summary implementation.
-- 
-- /Since: 2020.2/
signSummary ::
    (B.CallStack.HasCallStack, MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) =>
    a
    -- ^ /@self@/: Self
    -> b
    -- ^ /@repo@/: ostree repository
    -> GVariant
    -- ^ /@keys@/: keys -- GVariant containing keys as GVarints specific to signature type.
    -> Maybe (c)
    -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
signSummary :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsSign a, IsRepo b, IsCancellable c) =>
a -> b -> GVariant -> Maybe c -> m ()
signSummary a
self b
repo GVariant
keys Maybe c
cancellable = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    self' <- a -> IO (Ptr Sign)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    repo' <- unsafeManagedPtrCastPtr repo
    keys' <- unsafeManagedPtrGetPtr keys
    maybeCancellable <- case cancellable of
        Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just c
jCancellable -> do
            jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
            return jCancellable'
    onException (do
        _ <- propagateGError $ ostree_sign_summary self' repo' keys' maybeCancellable
        touchManagedPtr self
        touchManagedPtr repo
        touchManagedPtr keys
        whenJust cancellable touchManagedPtr
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data SignSummaryMethodInfo
instance (signature ~ (b -> GVariant -> Maybe (c) -> m ()), MonadIO m, IsSign a, OSTree.Repo.IsRepo b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod SignSummaryMethodInfo a signature where
    overloadedMethod = signSummary

instance O.OverloadedMethodInfo SignSummaryMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.OSTree.Interfaces.Sign.signSummary",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.19/docs/GI-OSTree-Interfaces-Sign.html#v:signSummary"
        })


#endif

-- method Sign::get_all
-- method type : MemberFunction
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TPtrArray
--                  (TInterface Name { namespace = "OSTree" , name = "Sign" }))
-- throws : False
-- Skip return : False

foreign import ccall "ostree_sign_get_all" ostree_sign_get_all :: 
    IO (Ptr (GPtrArray (Ptr Sign)))

-- | Return an array with newly allocated instances of all available
-- signing engines; they will not be initialized.
-- 
-- /Since: 2020.2/
signGetAll ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m [Sign]
    -- ^ __Returns:__ an array of signing engines
signGetAll :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Sign]
signGetAll  = IO [Sign] -> m [Sign]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Sign] -> m [Sign]) -> IO [Sign] -> m [Sign]
forall a b. (a -> b) -> a -> b
$ do
    result <- IO (Ptr (GPtrArray (Ptr Sign)))
ostree_sign_get_all
    checkUnexpectedReturnNULL "signGetAll" result
    result' <- unpackGPtrArray result
    result'' <- mapM (wrapObject Sign) result'
    unrefPtrArray result
    return result''

#if defined(ENABLE_OVERLOADING)
#endif

-- method Sign::get_by_name
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of desired signature engine"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "OSTree" , name = "Sign" })
-- throws : True
-- Skip return : False

foreign import ccall "ostree_sign_get_by_name" ostree_sign_get_by_name :: 
    CString ->                              -- name : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr Sign)

-- | Create a new instance of a signing engine.
-- 
-- /Since: 2020.2/
signGetByName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@name@/: the name of desired signature engine
    -> m Sign
    -- ^ __Returns:__ New signing engine, or 'P.Nothing' if the engine is not known /(Can throw 'Data.GI.Base.GError.GError')/
signGetByName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Sign
signGetByName Text
name = IO Sign -> m Sign
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Sign -> m Sign) -> IO Sign -> m Sign
forall a b. (a -> b) -> a -> b
$ do
    name' <- Text -> IO CString
textToCString Text
name
    onException (do
        result <- propagateGError $ ostree_sign_get_by_name name'
        checkUnexpectedReturnNULL "signGetByName" result
        result' <- (wrapObject Sign) result
        freeMem name'
        return result'
     ) (do
        freeMem name'
     )

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Sign = SignSignalList
type SignSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

#endif