1 #ifndef __DIGIDOC_ENC_H__ 2 #define __DIGIDOC_ENC_H__ 25 #include <openssl/x509.h> 26 #include <libdigidoc/DigiDocMem.h> 27 #include <libdigidoc/DigiDocConfig.h> 28 #include <libdigidoc/DigiDocDefs.h> 46 int nEncryptionProperties;
53 char* szEncryptionMethod;
55 char* szCarriedKeyName;
64 char* szEncryptionMethod;
83 char* szCarriedKeyName;
94 #define DENC_DATA_STATUS_UNINITIALIZED 0 95 #define DENC_DATA_STATUS_UNENCRYPTED_AND_NOT_COMPRESSED 1 96 #define DENC_DATA_STATUS_UNENCRYPTED_AND_COMPRESSED 2 97 #define DENC_DATA_STATUS_ENCRYPTED_AND_NOT_COMPRESSED 3 98 #define DENC_DATA_STATUS_ENCRYPTED_AND_COMPRESSED 4 100 #define DENC_KEY_STATUS_UNINITIALIZED 0 101 #define DENC_KEY_STATUS_INITIALIZED 1 102 #define DENC_KEY_STATUS_DISCARDED 2 104 #define ENCPROP_FILENAME "Filename" 105 #define ENCPROP_ORIG_SIZE "OriginalSize" 106 #define ENCPROP_ORIG_MIME "OriginalMimeType" 107 #define ENCPROP_ORIG_CONTENT "orig_file" 108 #define ENCPROP_LIB_VERSION "LibraryVersion" 109 #define ENCPROP_DOC_FORMAT "DocumentFormat" 111 #define DENC_FORMAT_ENCDOC_XML "ENCDOC-XML" 112 #define DENC_VERSION_1_0 "1.0" 113 #define DENC_VERSION_1_1 "1.1" 115 #define DENC_COMPRESS_ALLWAYS 0 116 #define DENC_COMPRESS_NEVER 1 117 #define DENC_COMPRESS_BEST_EFFORT 2 119 #define DENC_ENCRYPTED_KEY_LEN 128 120 #define DENC_DECRYPTED_KEY_LEN 16 125 #define DENC_ENCDATA_TYPE_DDOC "http://www.sk.ee/DigiDoc/v1.3.0/digidoc.xsd" 127 #define DENC_ENCDATA_MIME_XML "text/xml" 128 #define DENC_ENCDATA_MIME_ZLIB "http://www.isi.edu/in-noes/iana/assignments/media-types/application/zip" 130 #define DENC_ENC_METHOD_AES128 "http://www.w3.org/2001/04/xmlenc#aes128-cbc" 131 #define DENC_ENC_METHOD_RSA1_5 "http://www.w3.org/2001/04/xmlenc#rsa-1_5" 132 #define DENC_ENC_METHOD_RSA1_5_BUGGY "http://www.w3.org/2001/04/xmlenc#rsa-1-5" 133 #define DENC_XMLNS_XMLENC "http://www.w3.org/2001/04/xmlenc#" 134 #define DENC_XMLNS_XMLENC_ELEMENT "http://www.w3.org/2001/04/xmlenc#Element" 135 #define DENC_XMLNS_XMLENC_CONTENT "http://www.w3.org/2001/04/xmlenc#Content" 136 #define DENC_XMLNS_XMLENC_ENCPROP "http://www.w3.org/2001/04/xmlenc#EncryptionProperties" 137 #define DENC_XMLNS_XMLDSIG "http://www.w3.org/2000/09/xmldsig#" 153 const char* szXmlNs,
const char* szEncMethod,
154 const char* szId,
const char* szType,
155 const char* szMimeType);
193 EXP_OPTION
const char* dencEncryptedData_GetMimeType(
DEncEncryptedData* pEncData);
207 EXP_OPTION
const char* dencEncryptedData_GetEncryptionMethod(
DEncEncryptedData* pEncData);
214 EXP_OPTION
const char* dencEncryptedData_GetEncryptionPropertiesId(
DEncEncryptedData* pEncData);
221 EXP_OPTION
int dencEncryptedData_GetEncryptionPropertiesCount(
DEncEncryptedData* pEncData);
251 EXP_OPTION
int dencEncryptedData_GetEncryptedKeyCount(
DEncEncryptedData* pEncData);
297 EXP_OPTION
int dencEncryptedData_GetEncryptedDataStatus(
DEncEncryptedData* pEncData);
308 EXP_OPTION
int dencEncryptedData_SetId(
DEncEncryptedData* pEncData,
const char* value);
316 EXP_OPTION
int dencEncryptedData_SetType(
DEncEncryptedData* pEncData,
const char* value);
324 EXP_OPTION
int dencEncryptedData_SetMimeType(
DEncEncryptedData* pEncData,
const char* value);
332 EXP_OPTION
int dencEncryptedData_SetXmlNs(
DEncEncryptedData* pEncData,
const char* value);
340 EXP_OPTION
int dencEncryptedData_SetEncryptionMethod(
DEncEncryptedData* pEncData,
const char* value);
350 EXP_OPTION
int dencEncryptedData_AppendData(
DEncEncryptedData* pEncData,
const char* data,
int len);
358 EXP_OPTION
int dencEncryptedData_SetEncryptionPropertiesId(
DEncEncryptedData* pEncData,
const char* value);
366 EXP_OPTION
int dencEncryptedData_DeleteEncryptionProperty(
DEncEncryptedData* pEncData,
int nIdx);
374 EXP_OPTION
int dencEncryptedData_DeleteEncryptedKey(
DEncEncryptedData* pEncData,
int nIdx);
391 const char* szId,
const char* szTarget,
392 const char* szName,
const char* szContent);
485 const char* szEncMethod,
const char* szId,
486 const char* szRecipient,
const char* szKeyName,
487 const char* szCarriedKeyName);
510 EXP_OPTION
const char* dencEncryptedKey_GetRecipient(
DEncEncryptedKey* pEncKey);
517 EXP_OPTION
const char* dencEncryptedKey_GetEncryptionMethod(
DEncEncryptedKey* pEncKey);
524 EXP_OPTION
const char* dencEncryptedKey_GetKeyName(
DEncEncryptedKey* pEncKey);
531 EXP_OPTION
const char* dencEncryptedKey_GetCarriedKeyName(
DEncEncryptedKey* pEncKey);
538 EXP_OPTION X509* dencEncryptedKey_GetCertificate(
DEncEncryptedKey* pEncKey);
548 EXP_OPTION
int dencEncryptedKey_SetId(
DEncEncryptedKey* pEncKey,
const char* value);
556 EXP_OPTION
int dencEncryptedKey_SetRecipient(
DEncEncryptedKey* pEncKey,
const char* value);
564 EXP_OPTION
int dencEncryptedKey_SetEncryptionMethod(
DEncEncryptedKey* pEncKey,
const char* value);
572 EXP_OPTION
int dencEncryptedKey_SetKeyName(
DEncEncryptedKey* pEncKey,
const char* value);
580 EXP_OPTION
int dencEncryptedKey_SetCarriedKeyName(
DEncEncryptedKey* pEncKey,
const char* value);
588 EXP_OPTION
int dencEncryptedKey_SetCertificate(
DEncEncryptedKey* pEncKey, X509* value);
625 EVP_PKEY** ppKey,
const char* szPkcs12File,
const char* szPasswd);
634 EXP_OPTION
int dencEncryptedData_encryptData(
DEncEncryptedData* pEncData,
int nCompressOption);
645 const char* tKey,
int keyLen);
676 const char* pin,
int nSlot);
697 EXP_OPTION
int dencEncryptedData_compressData(
DEncEncryptedData* pEncData,
int nCompressOption);
721 EXP_OPTION
int dencRecvInfo_new(
DEncRecvInfo** ppRecvInfo,
722 const char* szId,
const char* szRecipient,
723 const char* szKeyName,
const char* szCarriedKeyName,
731 EXP_OPTION
int dencRecvInfo_free(
DEncRecvInfo* pRecvInfo);
738 EXP_OPTION
int dencRecvInfo_store(
DEncRecvInfo* pRecvInfo);
755 EXP_OPTION
int dencRecvInfo_delete(
DEncRecvInfo* pRecvInfo);
788 EXP_OPTION
int dencRecvInfoList_delete(
DEncRecvInfoList* pRecvInfoList,
const char* szId);
803 const char* szInputFileName,
const char* szOutputFileName,
804 const char* szMimeType);
825 EXP_OPTION
int dencOrigContent_add(
DEncEncryptedData* pEncData,
const char* szOrigContentId,
826 const char* szName,
const char* szSize,
const char* szMime,
const char* szDfId);
842 EXP_OPTION
int dencOrigContent_findByIndex(
DEncEncryptedData* pEncData,
int origContIdx,
843 char* szName,
int nNameLen,
char* szSize,
int nSizeLen,
844 char* szMime,
int nMimeLen,
char* szDfId,
int nDfIdLen);
888 EXP_OPTION
int dencMetaInfo_GetLibVersion(
DEncEncryptedData* pEncData,
char* szLibrary,
int nLibLen,
char* szVersion,
int nVerLen);
895 EXP_OPTION
int dencMetaInfo_GetFormatVersion(
DEncEncryptedData* pEncData,
char* szFormat,
int nFormatLen,
char* szVersion,
int nVerLen);
915 #endif // __DIGIDOC_ENC_H__ Definition: DigiDocEnc.h:79
Definition: DigiDocEnc.h:35
Definition: DigiDocEnc.h:50
Definition: DigiDocObj.h:177
Definition: DigiDocEnc.h:43
Definition: DigiDocEnc.h:87
Definition: DigiDocMem.h:32
Definition: DigiDocEnc.h:60
Definition: DigiDocConfig.h:65