cryptkeyrsa.h
Go to the documentation of this file.
/***************************************************************************
begin : Mon May 07 2012
copyright : (C) 2012 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* Please see toplevel file COPYING for license details *
***************************************************************************/
#ifndef GWEN_CRYPT_KEY_RSA_H
#define GWEN_CRYPT_KEY_RSA_H
#include "cryptkey.h"
#include <gwenhywfar/cryptkeyrsa.h>
#define GWEN_CRYPT_KEYRSA_FLAGS_DIRECTSIGN 0x00000001
#define GWEN_CRYPT_KEYRSA_FLAGS_ISVERIFIED 0x00000002
#define GWEN_CRYPT_KEYRSA_MAX_KEYLENGTH 1024
#ifdef __cplusplus
extern "C" {
#endif
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GeneratePair(unsigned int nbytes,
int use65537e,
GWEN_CRYPT_KEY **pPubKey,
GWEN_CRYPT_KEY **pSecretKey);
#ifndef NO_DEPRECATED_SYMBOLS
GWENHYWFAR_API GWEN_DEPRECATED
int GWEN_Crypt_KeyRsa_GeneratePair2(unsigned int nbits, int use65537e,
GWEN_CRYPT_KEY **pPubKey,
GWEN_CRYPT_KEY **pSecretKey);
#endif // ifndef NO_DEPRECATED_SYMBOLS
GWENHYWFAR_API GWEN_CRYPT_KEY *GWEN_Crypt_KeyRsa_dup(const GWEN_CRYPT_KEY *k);
GWENHYWFAR_API GWEN_CRYPT_KEY *GWEN_Crypt_KeyRsa_fromDb(GWEN_DB_NODE *db);
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_toDb(const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db, int pub);
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetModulus(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetSecretExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
GWENHYWFAR_API GWEN_CRYPT_KEY *GWEN_Crypt_KeyRsa_fromModExp(unsigned int nbytes,
const uint8_t *pModulus,
uint32_t lModulus,
const uint8_t *pExponent,
uint32_t lExponent);
GWENHYWFAR_API GWEN_CRYPT_KEY *GWEN_Crypt_KeyRsa_fromModPrivExp(unsigned int nbytes,
const uint8_t *pModulus,
uint32_t lModulus,
const uint8_t *pExponent,
uint32_t lExponent,
const uint8_t *pPrivExponent,
uint32_t lPrivExponent);
GWENHYWFAR_API uint32_t GWEN_Crypt_KeyRsa_GetFlags(const GWEN_CRYPT_KEY *k);
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_SetFlags(GWEN_CRYPT_KEY *k, uint32_t fl);
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_AddFlags(GWEN_CRYPT_KEY *k, uint32_t fl);
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_SubFlags(GWEN_CRYPT_KEY *k, uint32_t fl);
#ifdef __cplusplus
}
#endif
#endif
cryptkey.h
GWEN_CRYPT_KEY
struct GWEN_CRYPT_KEY GWEN_CRYPT_KEY
Definition cryptkey.h:26
cryptkeyrsa.h
GWEN_Crypt_KeyRsa_GetFlags
GWENHYWFAR_API uint32_t GWEN_Crypt_KeyRsa_GetFlags(const GWEN_CRYPT_KEY *k)
GWEN_Crypt_KeyRsa_AddFlags
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_AddFlags(GWEN_CRYPT_KEY *k, uint32_t fl)
GWEN_Crypt_KeyRsa_dup
GWENHYWFAR_API GWEN_CRYPT_KEY * GWEN_Crypt_KeyRsa_dup(const GWEN_CRYPT_KEY *k)
GWEN_Crypt_KeyRsa_SetFlags
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_SetFlags(GWEN_CRYPT_KEY *k, uint32_t fl)
GWEN_Crypt_KeyRsa_GetSecretExponent
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetSecretExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen)
GWEN_Crypt_KeyRsa_toDb
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_toDb(const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db, int pub)
GWEN_Crypt_KeyRsa_SubFlags
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_SubFlags(GWEN_CRYPT_KEY *k, uint32_t fl)
GWEN_Crypt_KeyRsa_fromModExp
GWENHYWFAR_API GWEN_CRYPT_KEY * GWEN_Crypt_KeyRsa_fromModExp(unsigned int nbytes, const uint8_t *pModulus, uint32_t lModulus, const uint8_t *pExponent, uint32_t lExponent)
GWEN_Crypt_KeyRsa_fromModPrivExp
GWENHYWFAR_API GWEN_CRYPT_KEY * GWEN_Crypt_KeyRsa_fromModPrivExp(unsigned int nbytes, const uint8_t *pModulus, uint32_t lModulus, const uint8_t *pExponent, uint32_t lExponent, const uint8_t *pPrivExponent, uint32_t lPrivExponent)
GWEN_Crypt_KeyRsa_GetExponent
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen)
GWEN_Crypt_KeyRsa_GeneratePair2
GWENHYWFAR_API GWEN_DEPRECATED int GWEN_Crypt_KeyRsa_GeneratePair2(unsigned int nbits, int use65537e, GWEN_CRYPT_KEY **pPubKey, GWEN_CRYPT_KEY **pSecretKey)
GWEN_Crypt_KeyRsa_fromDb
GWENHYWFAR_API GWEN_CRYPT_KEY * GWEN_Crypt_KeyRsa_fromDb(GWEN_DB_NODE *db)
GWEN_Crypt_KeyRsa_GetModulus
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetModulus(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen)
GWEN_Crypt_KeyRsa_GeneratePair
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GeneratePair(unsigned int nbytes, int use65537e, GWEN_CRYPT_KEY **pPubKey, GWEN_CRYPT_KEY **pSecretKey)
GWEN_DB_NODE
struct GWEN_DB_NODE GWEN_DB_NODE
Definition db.h:228
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWEN_DEPRECATED
#define GWEN_DEPRECATED
Definition gwenhywfarapi.h:149