Top | ![]() |
![]() |
![]() |
![]() |
int | geier_init () |
int | geier_exit () |
geier_context * | geier_context_new () |
void | geier_context_free () |
int | geier_send () |
int | geier_send_text () |
char * | geier_get_clearing_error () |
char * | geier_get_clearing_error_text () |
int | geier_send_encrypted () |
int | geier_send_encrypted_text () |
int | geier_encrypt () |
int | geier_encrypt_text () |
int | geier_decrypt () |
int | geier_decrypt_text () |
int | geier_xml_to_text () |
int | geier_xml_to_encoded_text () |
int | geier_text_to_xml () |
int | geier_validate () |
int | geier_validate_text () |
int | geier_dsig_sign () |
int | geier_dsig_sign_softpse () |
int | geier_dsig_sign_opensc () |
int | geier_dsig_sign_text () |
int | geier_dsig_sign_softpse_text () |
int | geier_dsig_sign_opensc_text () |
int | geier_xsltify () |
int | geier_xsltify_text () |
int
geier_init (int debug
);
Initialize GEIER library as well as libxml, libxmlsec, libxslt in turn. This has to be called first.
int
geier_exit (void
);
Shut the GEIER library down. Ask libxml, libxmlsec, libxslt to shut down as well. This should be called last.
void
geier_context_free (geier_context *context
);
Deallocates a previously allocated geier_context.
int geier_send (geier_context *context
,const xmlDoc *input
,xmlDoc **output
);
Send the Elster-XML document, which is supplied as input
, like
geier_send_encrypted does, but automatically take care of encryption
and decryption. Furthermore compression and Base64 encoding is
handled internally.
Beware that this functions returns 0
upon successful transmission, this
is, if the transmitted data is invalid, 0
is returned no matter what.
See geier_get_clearing_error for details.
int geier_send_text (geier_context *context
,const unsigned char *input
,size_t inlen
,unsigned char **output
,size_t *outlen
);
Send the Elster-XML document, which is supplied as input
, like
geier_send_encrypted_text, but automatically take care of encryption
and decryption. Furthermore compression and Base64 encoding is
handled automatically.
Beware that this functions returns 0
upon successful transmission, this
is, if the transmitted data is invalid, 0
is returned no matter what.
See geier_get_clearing_error_text for details.
char * geier_get_clearing_error (geier_context *context
,const xmlDoc *input
);
Check the provided (unencrypted) Elster-XML document, supplied as input
,
for error codes and return suitable error messages. input
should be
a XML document supplied by one of the clearing hosts as returned by
geier_send.
char * geier_get_clearing_error_text (geier_context *context
,const unsigned char *input
,size_t inlen
);
Check the provided (unencrypted) Elster-XML document, supplied as input
,
for error codes and return suitable error messages. input
should be
a XML document supplied by one of the clearing hosts as returned by
geier_send_text.
int geier_send_encrypted (geier_context *context
,const xmlDoc *input
,xmlDoc **output
);
Send an already encrypted Elster-XML document, which is supplied as
input
, quite like geier_send does. But unlike the latter don't
care for encipherment. This is, geier_send_encrypted relies on
input
being encrypted using geier_encrypt already.
Beware that this functions returns 0
upon successful transmission, this
is, if the transmitted data is invalid, 0
is returned no matter what.
See geier_get_clearing_error for details.
int geier_send_encrypted_text (geier_context *context
,const unsigned char *input
,size_t inlen
,unsigned char **output
,size_t *outlen
);
Send an already encrypted Elster-XML document, which is supplied as
input
, quite like geier_send_text does. But unlike the latter
don't care for encipherment. This is, geier_send_encrypted_text
relies on input
being encrypted using geier_encrypt_text already.
Beware that this functions returns 0
upon successful transmission, this
is, if the transmitted data is invalid, 0
is returned no matter what.
See geier_get_clearing_error_text for details.
int geier_encrypt (geier_context *context
,const xmlDoc *input
,xmlDoc **output
);
Encrypt the relevant parts (those the Coala specification requires to be
crypted) of the provided Elster-XML document (supplied as input
).
Furthermore compression and Base64 encoding is handled automatically.
int geier_encrypt_text (geier_context *context
,const unsigned char *input
,size_t inlen
,unsigned char **output
,size_t *outlen
);
Encrypt the relevant parts (those the Coala specification requires to be
crypted) of the provided Elster-XML document (supplied as input
).
Furthermore compression and Base64 encoding is handled automatically.
int geier_decrypt (geier_context *context
,const xmlDoc *input
,xmlDoc **output
);
Decrypt the encrypted parts (those that the Coala specification requires
to be sent encrypted) of the Elster-XML document provided as input
.
Furthermore decompression and Base64 decoding is handled
internally.
Please mind, that you cannot use geier_decrypt to decrypt data that has been enciphered and sent using another geier_context. This is due to the 3DES key to be contained in the geier_context.
int geier_decrypt_text (geier_context *context
,const unsigned char *input
,size_t inlen
,unsigned char **output
,size_t *outlen
);
Decrypt the encrypted parts (those that the Coala specification requires
to be sent encrypted) of the Elster-XML document provided as input
.
Furthermore decompression and Base64 decoding is handled internally.
Please mind, that you cannot use geier_decrypt to decrypt data that has been enciphered and sent using another geier_context. This is due to the 3DES key to be contained in the geier_context.
int geier_xml_to_text (geier_context *context
,const xmlDoc *input
,unsigned char **output
,size_t *outlen
);
Convert the XML document to a zero-terminated C string.
int geier_xml_to_encoded_text (geier_context *context
,const xmlDoc *input
,const char *encoding
,unsigned char **output
,size_t *outlen
);
Convert the XML document to a zero-terminated C string, like
geier_xml_to_text does, but furthermore convert to encoding encoding
.
int geier_text_to_xml (geier_context *context
,const unsigned char *input
,size_t inlen
,xmlDoc **output
);
Convert the XML document, supplied as a C string as input
, to a libxml
XML document.
int geier_validate (geier_context *context
,geier_format f
,const xmlDoc *input
);
Validate the Elster-XML document against the Schema files supplied by the German fiscal authorities and shipped along with libgeier.
Please mind the the only geier_format (f
) that currently is supported
by geier_validate is geier_format_unencrypted.
int geier_validate_text (geier_context *context
,geier_format f
,const unsigned char *input
,size_t inlen
);
Validate the Elster-XML document against the Schema files supplied by the German fiscal authorities and shipped along with libgeier.
Please mind the the only geier_format (f
) that currently is supported
by geier_validate_text is geier_format_unencrypted.
context |
||
f |
geier_format specifier. |
|
input |
the XML document that should be validated, supplied as a C string. |
|
inlen |
the length of |
int geier_dsig_sign (geier_context *context
,const xmlDoc *input
,xmlDoc **output
,const char *softpse_filename
,const char *pincode
);
Sign the provided Elster-XML document (supplied as input
) with the software
certificate, that is automatically extracted from the PKCS#12 file with
the provided filename. The pincode
is used to decrypt the container.
Deprecated
: This funtion has been renamed since 0.8. Please use
geier_dsig_sign_softpse, which has exactly the same signature.
int geier_dsig_sign_softpse (geier_context *context
,const xmlDoc *input
,xmlDoc **output
,const char *softpse_filename
,const char *pincode
);
Sign the provided Elster-XML document (supplied as input
) with the software
certificate, that is automatically extracted from the PKCS#12 file with
the provided filename. The pincode
is used to decrypt the container.
int geier_dsig_sign_opensc (geier_context *context
,const xmlDoc *input
,xmlDoc **output
,unsigned int cert_id
);
Sign the provided Elster-XML document (supplied as input
) using a
smartcard. You need to specify the ID of the certificate to use for
signing as cert_id
, as it is returned by pkcs15-tool.
This function is only available in OpenSSL-based libgeier versions.
int geier_dsig_sign_text (geier_context *context
,const unsigned char *input
,size_t inlen
,unsigned char **output
,size_t *outlen
,const char *softpse_filename
,const char *pincode
);
Sign the provided Elster-XML document (supplied as input
) with the software
certificate, that is automatically extracted from the PKCS#12 file with
the provided filename. The pincode
is used to decrypt the container.
Deprecated
: This funtion has been renamed since 0.8. Please use
geier_dsig_sign_softpse_text, which has exactly the same signature.
context |
||
input |
the XML document that should be signed, supplied as a C string. |
|
inlen |
the length of |
|
output |
pointer to where the resulting XML document should be written to (as a C string) |
|
outlen |
the length of the buffer |
|
softpse_filename |
name of the PKCS#12 container file. |
|
pincode |
the pincode. |
int geier_dsig_sign_softpse_text (geier_context *context
,const unsigned char *input
,size_t inlen
,unsigned char **output
,size_t *outlen
,const char *softpse_filename
,const char *pincode
);
Sign the provided Elster-XML document (supplied as input
) with the software
certificate, that is automatically extracted from the PKCS#12 file with
the provided filename. The pincode
is used to decrypt the container.
context |
||
input |
the XML document that should be signed, supplied as a C string. |
|
inlen |
the length of |
|
output |
pointer to where the resulting XML document should be written to (as a C string) |
|
outlen |
the length of the buffer |
|
softpse_filename |
name of the PKCS#12 container file. |
|
pincode |
the pincode. |
int geier_dsig_sign_opensc_text (geier_context *context
,const unsigned char *input
,size_t inlen
,unsigned char **output
,size_t *outlen
,unsigned int cert_id
);
Sign the provided Elster-XML document (supplied as input
) using a
smartcard. You need to specify the ID of the certificate to use for
signing as cert_id
, as it is returned by pkcs15-tool.
This function is only available in OpenSSL-based libgeier versions.
int geier_xsltify (geier_context *context
,const xmlDoc *input
,xmlDoc **output
);
Automatically generate a transmission protocol for the Elster-XML
document, that is supplied as input
. The protocol is generated
using the XSLT-File that is shipped along with this library.
You can call this function even before calling geier_send, this will result in a common protocol that only states that it has been printed before transmission.
int geier_xsltify_text (geier_context *context
,const unsigned char *input
,size_t inlen
,unsigned char **output
,size_t *outlen
);
Automatically generate a transmission protocol for the Elster-XML
document, that is supplied as input
. The protocol is generated
using the XSLT-File that is shipped along with this library.
You can call this function even before calling geier_send_text, this will result in a common protocol that only states that it has been printed before transmission.
typedef struct _geier_context geier_context;
A transparent structure, that has to be passed to most of the functions contained in this library. It mainly is used to store encoder information as well as session keys, needed when sending data to the fiscal authorities.
Please make sure not to call two library functions using the same context within two different threads. Everything else should be threadsafe.
Format specifier that has to be passed to geier_validate and geier_validate_text for those to distinct between different Elster-XML tree flavours.
Please mind, that currently only geier_format_unencrypted is supported.