gwenhywfar  4.7.0beta
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 
24 
25 #define GWEN_CRYPT_KEYRSA_MAX_KEYLENGTH 1024
26 
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
40 GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GeneratePair(unsigned int nbytes,
41  int use65537e,
42  GWEN_CRYPT_KEY **pPubKey,
43  GWEN_CRYPT_KEY **pSecretKey);
44 
45 
55 GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GeneratePair2(unsigned int nbits, int use65537e,
56  GWEN_CRYPT_KEY **pPubKey,
57  GWEN_CRYPT_KEY **pSecretKey);
58 
60 
63 
64 GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetModulus(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
65 GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
66 GWENHYWFAR_API int GWEN_Crypt_KeyRsa_GetSecretExponent(const GWEN_CRYPT_KEY *k, uint8_t *buffer, uint32_t *pBufLen);
67 
69  const uint8_t *pModulus,
70  uint32_t lModulus,
71  const uint8_t *pExponent,
72  uint32_t lExponent);
73 
75  const uint8_t *pModulus,
76  uint32_t lModulus,
77  const uint8_t *pExponent,
78  uint32_t lExponent,
79  const uint8_t *pPrivExponent,
80  uint32_t lPrivExponent);
81 
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
91 #endif
92