# lib/signature.h

Go to the documentation of this file.

    00001 #ifndef H_SIGNATURE
    00002 #define H_SIGNATURE
    00003
    00009 #include <header.h>
    00010
    00014 typedef enum sigType_e {
    00015     RPMSIGTYPE_NONE     = 0,
    00016     RPMSIGTYPE_PGP262_1024 = 1,
    00017 /*@-enummemuse@*/
    00018     RPMSIGTYPE_BAD      = 2,
    00019 /*@=enummemuse@*/
    00020     RPMSIGTYPE_MD5      = 3,
    00021     RPMSIGTYPE_MD5_PGP  = 4,
    00022     RPMSIGTYPE_HEADERSIG= 5,
    00023     RPMSIGTYPE_DISABLE  = 6
    00024 } sigType;
    00025
    00030 typedef enum pgpVersion_e {
    00031     PGP_NOTDETECTED     = -1,
    00032     PGP_UNKNOWN         = 0,
    00033     PGP_2               = 2,
    00034     PGP_5               = 5
    00035 } pgpVersion;
    00036
    00037 #ifdef __cplusplus
    00038 extern "C" {
    00039 #endif
    00040
    00045 Header rpmNewSignature(void)    /*@*/;
    00046
    00055 rpmRC rpmReadSignature(FD_t fd, /*@null@*/ /*@out@*/ Header *headerp,
    00056                 sigType sig_type)
    00057         /*@modifies fd, *headerp @*/;
    00058
    00065 int rpmWriteSignature(FD_t fd, Header h)
    00066         /*@globals fileSystem @*/
    00067         /*@modifies fd, h, fileSystem @*/;
    00068
    00072 int rpmAddSignature(Header h, const char * file,
    00073                     int_32 sigTag, /*@null@*/ const char * passPhrase)
    00074         /*@globals rpmGlobalMacroContext @*/
    00075         /*@modifies h, rpmGlobalMacroContext @*/;
    00076
    00077 /******************************************************************/
    00078
    00079 /* Possible actions for rpmLookupSignatureType() */
    00080 #define RPMLOOKUPSIG_QUERY      0       /* Lookup type in effect          */
    00081 #define RPMLOOKUPSIG_DISABLE    1       /* Disable (--sign was not given) */
    00082 #define RPMLOOKUPSIG_ENABLE     2       /* Re-enable %_signature          */
    00083
    00087 int rpmLookupSignatureType(int action)
    00088         /*@globals rpmGlobalMacroContext, internalState @*/
    00089         /*@modifies rpmGlobalMacroContext, internalState @*/;
    00090
    00094 /*@null@*/ char * rpmGetPassPhrase(const char *prompt, const int sigTag)
    00095         /*@globals rpmGlobalMacroContext, fileSystem @*/
    00096         /*@modifies rpmGlobalMacroContext, fileSystem @*/;
    00097
    00101 /*@-redecl@*/
    00102 /*@null@*/ const char * rpmDetectPGPVersion(
    00103                         /*@null@*/ /*@out@*/ pgpVersion * pgpVer)
    00104         /*@globals rpmGlobalMacroContext, fileSystem @*/
    00105         /*@modifies *pgpVer, rpmGlobalMacroContext, fileSystem @*/;
    00106 /*@=redecl@*/
    00107
    00108 #ifdef __cplusplus
    00109 }
    00110 #endif
    00111
    00112 #endif  /* H_SIGNATURE */