|
rpm 6.0.1
The RPM Package Manager
|
RPM cryptography related APIs and constants. More...
Typedefs | |
| typedef struct DIGEST_CTX_s * | DIGEST_CTX |
| typedef enum rpmHashAlgo_e | rpmHashAlgo |
Enumerations | |
| 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 , RPM_HASH_SHA3_256 = 12 , RPM_HASH_SHA3_512 = 14 } |
| enum | rpmDigestFlags_e { RPMDIGEST_NONE = 0 } |
Functions | |
| 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 | rpmDigestBundleUpdateID (rpmDigestBundle bundle, int id, 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) |
RPM cryptography related APIs and constants.
| typedef enum rpmHashAlgo_e rpmHashAlgo |
At this time these simply mirror PGPHASHALGO numbers. Once they start * growing apart we'll need converters.
| enum rpmDigestFlags_e |
Bit(s) to control digest operation.
| enum rpmHashAlgo_e |
At this time these simply mirror PGPHASHALGO numbers. Once they start * growing apart we'll need converters.
| int rpmDigestBundleAdd | ( | rpmDigestBundle | bundle, |
| int | algo, | ||
| rpmDigestFlags | flags ) |
Add a new type of digest to a bundle. Same as calling rpmDigestBundleAddID() with algo == id value.
| bundle | digest bundle |
| algo | type of digest |
| flags | bit(s) to control digest operation |
| int rpmDigestBundleAddID | ( | rpmDigestBundle | bundle, |
| int | algo, | ||
| int | id, | ||
| rpmDigestFlags | flags ) |
Add a new type of digest to a bundle.
| bundle | digest bundle |
| algo | type of digest |
| id | id of digest (arbitrary, must be > 0) |
| flags | bit(s) to control digest operation |
| DIGEST_CTX rpmDigestBundleDupCtx | ( | rpmDigestBundle | bundle, |
| int | id ) |
Duplicate a digest context from a bundle.
| bundle | digest bundle |
| id | id of digest to dup |
| int rpmDigestBundleFinal | ( | rpmDigestBundle | bundle, |
| int | id, | ||
| void ** | datap, | ||
| size_t * | lenp, | ||
| int | asAscii ) |
Return digest from a bundle and destroy context, see rpmDigestFinal().
| bundle | digest bundle | |
| id | id of digest to return | |
| [out] | datap | address of returned digest |
| [out] | lenp | address of digest length |
| asAscii | return digest as ascii string? |
| rpmDigestBundle rpmDigestBundleFree | ( | rpmDigestBundle | bundle | ) |
Free a digest bundle and all contained digest contexts.
| bundle | digest bundle |
| rpmDigestBundle rpmDigestBundleNew | ( | void | ) |
Create a new digest bundle.
| int rpmDigestBundleUpdate | ( | rpmDigestBundle | bundle, |
| const void * | data, | ||
| size_t | len ) |
Update contexts within bundle with next plain text buffer.
| bundle | digest bundle |
| data | next data buffer |
| len | no. bytes of data |
| int rpmDigestBundleUpdateID | ( | rpmDigestBundle | bundle, |
| int | id, | ||
| const void * | data, | ||
| size_t | len ) |
Update context of an individual ID within bundle with next plain text buffer.
| bundle | digest bundle |
| id | id of digest (arbitrary, must be > 0) |
| data | next data buffer |
| len | no. bytes of data |
| DIGEST_CTX rpmDigestDup | ( | DIGEST_CTX | octx | ) |
Duplicate a digest context.
| octx | existing digest context |
| int rpmDigestFinal | ( | DIGEST_CTX | ctx, |
| void ** | datap, | ||
| size_t * | lenp, | ||
| int | asAscii ) |
Return digest and destroy context. Final wrapup - pad to 64-byte boundary with the bit pattern 1 0* (64-bit count of bits processed, MSB-first)
| ctx | digest context | |
| [out] | datap | address of returned digest |
| [out] | lenp | address of digest length |
| asAscii | return digest as ascii string? |
| DIGEST_CTX rpmDigestInit | ( | int | hashalgo, |
| rpmDigestFlags | flags ) |
Initialize digest. Set bit count to 0 and buffer to mysterious initialization constants.
| hashalgo | type of digest |
| flags | bit(s) to control digest operation |
| size_t rpmDigestLength | ( | int | hashalgo | ) |
Obtain digest length in bytes.
| hashalgo | type of digest |
| int rpmDigestUpdate | ( | DIGEST_CTX | ctx, |
| const void * | data, | ||
| size_t | len ) |
Update context with next plain text buffer.
| ctx | digest context |
| data | next data buffer |
| len | no. bytes of data |
| int rpmFreeCrypto | ( | void | ) |
Shutdown cryptography
| int rpmInitCrypto | ( | void | ) |
Perform cryptography initialization. It must be called before any cryptography can be used within rpm. It's not normally necessary to call it directly as it's called in general rpm initialization routines.