gwenhywfar  5.11.1beta
cryptkeyrsa.h
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Mon May 07 2012
3  copyright : (C) 2012 by Martin Preuss
4  email : martin@libchipcard.de
5 
6  ***************************************************************************
7  * Please see toplevel file COPYING for license details *
8  ***************************************************************************/
9 
10 
11 #ifndef GWEN_CRYPT_KEY_RSA_H
12 #define GWEN_CRYPT_KEY_RSA_H
13 
14 #include "cryptkey.h"
15 #include <gwenhywfar/cryptkeyrsa.h>
16 
17 
22 #define GWEN_CRYPT_KEYRSA_FLAGS_DIRECTSIGN 0x00000001
23 #define GWEN_CRYPT_KEYRSA_FLAGS_ISVERIFIED 0x00000002
24 
25 #define GWEN_CRYPT_KEYRSA_MAX_KEYLENGTH 1024
26 
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
41  int use65537e,
42  GWEN_CRYPT_KEY **pPubKey,
43  GWEN_CRYPT_KEY **pSecretKey);
44 
45 #ifndef NO_DEPRECATED_SYMBOLS
58 int GWEN_Crypt_KeyRsa_GeneratePair2(unsigned int nbits, int use65537e,
59  GWEN_CRYPT_KEY **pPubKey,
60  GWEN_CRYPT_KEY **pSecretKey);
61 #endif // ifndef NO_DEPRECATED_SYMBOLS
62 
64 
67 
68 GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetModulus(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
69 GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
70 GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetSecretExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
71 
73  const uint8_t *pModulus,
74  uint32_t lModulus,
75  const uint8_t *pExponent,
76  uint32_t lExponent);
77 
79  const uint8_t *pModulus,
80  uint32_t lModulus,
81  const uint8_t *pExponent,
82  uint32_t lExponent,
83  const uint8_t *pPrivExponent,
84  uint32_t lPrivExponent);
85 
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif
96 
struct GWEN_CRYPT_KEY GWEN_CRYPT_KEY
Definition: cryptkey.h:26
GWENHYWFAR_API uint32_t GWEN_Crypt_KeyRsa_GetFlags(const GWEN_CRYPT_KEY *k)
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_AddFlags(GWEN_CRYPT_KEY *k, uint32_t fl)
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_SetFlags(GWEN_CRYPT_KEY *k, uint32_t fl)
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetSecretExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen)
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_toDb(const GWEN_CRYPT_KEY *k, GWEN_DB_NODE *db, int pub)
GWENHYWFAR_API GWEN_CRYPT_KEY * GWEN_Crypt_KeyRsa_fromDb(GWEN_DB_NODE *db)
GWENHYWFAR_API void GWEN_Crypt_KeyRsa_SubFlags(GWEN_CRYPT_KEY *k, uint32_t fl)
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 int GWEN_Crypt_KeyRsa_GetExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen)
GWENHYWFAR_API GWEN_DEPRECATED int GWEN_Crypt_KeyRsa_GeneratePair2(unsigned int nbits, int use65537e, GWEN_CRYPT_KEY **pPubKey, GWEN_CRYPT_KEY **pSecretKey)
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_dup(const GWEN_CRYPT_KEY *k)
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetModulus(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen)
GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GeneratePair(unsigned int nbytes, int use65537e, GWEN_CRYPT_KEY **pPubKey, GWEN_CRYPT_KEY **pSecretKey)
struct GWEN_DB_NODE GWEN_DB_NODE
Definition: db.h:228
#define GWENHYWFAR_API
Definition: gwenhywfarapi.h:67
#define GWEN_DEPRECATED