rpmcrypto.h
Go to the documentation of this file.
#ifndef _RPMCRYPTO_H
#define _RPMCRYPTO_H
#include <rpm/rpmtypes.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct DIGEST_CTX_s * DIGEST_CTX;
typedef struct rpmDigestBundle_s * rpmDigestBundle;
typedef enum rpmHashAlgo_e {
RPM_HASH_MD5 = 1,
RPM_HASH_SHA1 = 2,
RPM_HASH_RIPEMD160 = 3,
RPM_HASH_MD2 = 5,
RPM_HASH_TIGER192 = 6,
RPM_HASH_HAVAL_5_160 = 7,
RPM_HASH_SHA256 = 8,
RPM_HASH_SHA384 = 9,
RPM_HASH_SHA512 = 10,
RPM_HASH_SHA224 = 11,
} rpmHashAlgo;
enum rpmDigestFlags_e {
RPMDIGEST_NONE = 0
};
typedef rpmFlags rpmDigestFlags;
int rpmInitCrypto(void);
int rpmFreeCrypto(void);
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx);
size_t rpmDigestLength(int hashalgo);
DIGEST_CTX rpmDigestInit(int hashalgo, rpmDigestFlags flags);
int rpmDigestUpdate(DIGEST_CTX ctx, const void * data, size_t len);
int rpmDigestFinal(DIGEST_CTX ctx, void ** datap, size_t * lenp, int asAscii);
rpmDigestBundle rpmDigestBundleNew(void);
rpmDigestBundle rpmDigestBundleFree(rpmDigestBundle bundle);
int rpmDigestBundleAdd(rpmDigestBundle bundle, int algo,
rpmDigestFlags flags);
int rpmDigestBundleAddID(rpmDigestBundle bundle, int algo, int id,
rpmDigestFlags flags);
int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len);
int rpmDigestBundleFinal(rpmDigestBundle bundle, int id,
void ** datap, size_t * lenp, int asAscii);
DIGEST_CTX rpmDigestBundleDupCtx(rpmDigestBundle bundle, int id);
#ifdef __cplusplus
}
#endif
#endif /* _RPMCRYPTO_H */
rpmInitCrypto
int rpmInitCrypto(void)
Perform cryptography initialization.
rpmDigestBundleFree
rpmDigestBundle rpmDigestBundleFree(rpmDigestBundle bundle)
Free a digest bundle and all contained digest contexts.
rpmDigestFlags_e
rpmDigestFlags_e
Bit(s) to control digest operation.
Definition: rpmcrypto.h:35
rpmDigestInit
DIGEST_CTX rpmDigestInit(int hashalgo, rpmDigestFlags flags)
Initialize digest.
rpmDigestBundleAdd
int rpmDigestBundleAdd(rpmDigestBundle bundle, int algo, rpmDigestFlags flags)
Add a new type of digest to a bundle.
rpmHashAlgo_e
rpmHashAlgo_e
At this time these simply mirror PGPHASHALGO numbers.
Definition: rpmcrypto.h:19
rpmDigestFinal
int rpmDigestFinal(DIGEST_CTX ctx, void **datap, size_t *lenp, int asAscii)
Return digest and destroy context.
rpmDigestBundleNew
rpmDigestBundle rpmDigestBundleNew(void)
Create a new digest bundle.
rpmDigestBundleFinal
int rpmDigestBundleFinal(rpmDigestBundle bundle, int id, void **datap, size_t *lenp, int asAscii)
Return digest from a bundle and destroy context, see rpmDigestFinal().
rpmDigestDup
DIGEST_CTX rpmDigestDup(DIGEST_CTX octx)
Duplicate a digest context.
rpmHashAlgo
enum rpmHashAlgo_e rpmHashAlgo
At this time these simply mirror PGPHASHALGO numbers.
rpmDigestLength
size_t rpmDigestLength(int hashalgo)
Obtain digest length in bytes.
rpmDigestBundleDupCtx
DIGEST_CTX rpmDigestBundleDupCtx(rpmDigestBundle bundle, int id)
Duplicate a digest context from a bundle.
rpmDigestUpdate
int rpmDigestUpdate(DIGEST_CTX ctx, const void *data, size_t len)
Update context with next plain text buffer.
rpmFreeCrypto
int rpmFreeCrypto(void)
Shutdown cryptography.
DIGEST_CTX
struct DIGEST_CTX_s * DIGEST_CTX
Definition: rpmcrypto.h:12
rpmDigestBundleAddID
int rpmDigestBundleAddID(rpmDigestBundle bundle, int algo, int id, rpmDigestFlags flags)
Add a new type of digest to a bundle.
rpmDigestBundleUpdate
int rpmDigestBundleUpdate(rpmDigestBundle bundle, const void *data, size_t len)
Update contexts within bundle with next plain text buffer.
RPMDIGEST_NONE
@ RPMDIGEST_NONE
Definition: rpmcrypto.h:36
RPM_HASH_SHA256
@ RPM_HASH_SHA256
Definition: rpmcrypto.h:26
RPM_HASH_SHA512
@ RPM_HASH_SHA512
Definition: rpmcrypto.h:28
RPM_HASH_MD2
@ RPM_HASH_MD2
Definition: rpmcrypto.h:23
RPM_HASH_TIGER192
@ RPM_HASH_TIGER192
Definition: rpmcrypto.h:24
RPM_HASH_SHA224
@ RPM_HASH_SHA224
Definition: rpmcrypto.h:29
RPM_HASH_HAVAL_5_160
@ RPM_HASH_HAVAL_5_160
Definition: rpmcrypto.h:25
RPM_HASH_RIPEMD160
@ RPM_HASH_RIPEMD160
Definition: rpmcrypto.h:22
RPM_HASH_SHA384
@ RPM_HASH_SHA384
Definition: rpmcrypto.h:27
RPM_HASH_MD5
@ RPM_HASH_MD5
Definition: rpmcrypto.h:20
RPM_HASH_SHA1
@ RPM_HASH_SHA1
Definition: rpmcrypto.h:21
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
rpmDigestFlags
rpmFlags rpmDigestFlags
Definition: rpmcrypto.h:39
rpmDigestBundle
struct rpmDigestBundle_s * rpmDigestBundle
Definition: rpmcrypto.h:13
rpmtypes.h
Typedefs for RPM abstract data types.