#include "constants.h"
Go to the source code of this file.
Macros | |
#define | BIDCSERVER_API __declspec(dllimport) |
#define | BIDCALLCONV __cdecl |
Typedefs | |
typedef int | SESSION_HANDLE |
Functions | |
BIDCSERVER_API int BIDCALLCONV | BID_Initialize () |
BIDCSERVER_API int BIDCALLCONV | BID_HSMInitialize (const char *pkcs11driver) |
BIDCSERVER_API int BIDCALLCONV | BID_Finalize () |
BIDCSERVER_API int BIDCALLCONV | BID_OpenSession (SESSION_HANDLE *sessioncontext, const char *keylocation, const char *password, const char *configlocation, const char *webaddress, const char *tagcache, const char *trustedstore, const char *grantedpolicies, const char *proxyserver, const char *proxyport) |
BIDCSERVER_API int BIDCALLCONV | BID_HSMOpenSession (SESSION_HANDLE *sessioncontext, const char *keylocation, const char *password, const char *configlocation, const char *webaddress, const char *tagcache, const char *trustedstore, const char *grantedpolicies, const char *proxyserver, const char *proxyport, const char *pkcs11password, const int slot) |
BIDCSERVER_API int BIDCALLCONV | BID_RAHSMOpenSession (SESSION_HANDLE *sessioncontext, const char *keylocation, const char *password, const char *pkcs11password, const int slot) |
BIDCSERVER_API int BIDCALLCONV | BID_CloseSession (SESSION_HANDLE sessioncontext) |
BIDCSERVER_API int BIDCALLCONV | BID_SignData (const SESSION_HANDLE sessioncontext, const unsigned char *data, const size_t datalen, char **pkcs7) |
BIDCSERVER_API int BIDCALLCONV | BID_SignXML (const int sessioncontext, const unsigned char *xml, const size_t xmllen, const unsigned char *xsl, const size_t xsllen, char **pkcs7, char **data) |
BIDCSERVER_API int BIDCALLCONV | BID_SignDataP1 (const SESSION_HANDLE sessioncontext, const unsigned char *data, const size_t datalen, char **pkcs1) |
BIDCSERVER_API int BIDCALLCONV | BID_CreateXMLDSIG (const SESSION_HANDLE sessioncontext, const char *c14nxmlorder, char **xmldsig, int *certexpiresin) |
BIDCSERVER_API int BIDCALLCONV | BID_VerifyData (const SESSION_HANDLE sessioncontext, const char *pkcs7, const unsigned char *data, const size_t datalen) |
BIDCSERVER_API int BIDCALLCONV | BID_HashVerifyData (const SESSION_HANDLE sessioncontext, const char *pkcs7, const char *hash, const int auth) |
BIDCSERVER_API int BIDCALLCONV | BID_AuthenticateClient (const SESSION_HANDLE sessioncontext, const char *pkcs7, const char *serverchallenge) |
BIDCSERVER_API int BIDCALLCONV | BID_AuthenticateServer (const SESSION_HANDLE sessioncontext, char **pkcs7, char **serverchallenge, const char *clientchallenge, const char *authenticationheader, const char *prepareText) |
BIDCSERVER_API int BIDCALLCONV | BID_HashData (const SESSION_HANDLE sessioncontext, char **hash, const int hashalgorithm, const char *data) |
BIDCSERVER_API int BIDCALLCONV | BID_GetRandom (const SESSION_HANDLE sessioncontext, char **rand, const size_t randlen) |
BIDCSERVER_API int BIDCALLCONV | BID_Base64Encode (const SESSION_HANDLE sessioncontext, const unsigned char *in, const size_t inlen, char **out) |
BIDCSERVER_API int BIDCALLCONV | BID_Base64Decode (const SESSION_HANDLE sessioncontext, const char *in, unsigned char **out, size_t *outlen) |
BIDCSERVER_API int BIDCALLCONV | BID_RemoveCRLF (const SESSION_HANDLE sessioncontext, const char *in, char **out) |
BIDCSERVER_API int BIDCALLCONV | BID_GetPKCS7Info (const SESSION_HANDLE sessioncontext, const char *pkcs7, const int infoitem, char **out) |
BIDCSERVER_API int BIDCALLCONV | BID_SetInfoItem (const SESSION_HANDLE sessioncontext, const char *key, const char *value) |
BIDCSERVER_API int BIDCALLCONV | BID_GetInfoItem (const SESSION_HANDLE sessioncontext, const char *key, char **value) |
BIDCSERVER_API int BIDCALLCONV | BID_RemoveInfoItems (const SESSION_HANDLE sessioncontext) |
BIDCSERVER_API int BIDCALLCONV | BID_GetCertStatus (const SESSION_HANDLE sessioncontext, const char *pkcs7, char **ocspresponse) |
BIDCSERVER_API int BIDCALLCONV | BID_GetOwnCertStatus (const SESSION_HANDLE sessioncontext, char **ocspresponse) |
BIDCSERVER_API int BIDCALLCONV | BID_CreateSDO (const SESSION_HANDLE sessioncontext, BID_SEIDSDO **sdo, const char *data, const char *datatype, const char *datadescription, const char *clientpkcs7, const char *serverpkcs7, const char *clientocspresponse, const char *serverocspresponse) |
BIDCSERVER_API int BIDCALLCONV | BID_CreateDynamicSDO (const SESSION_HANDLE sessioncontext, BID_SEIDSDO **sdo, const char *data, const char *datatype, const char *datadescription, const BID_Signature *signatures) |
BIDCSERVER_API int BIDCALLCONV | BID_SDOToXMLEx (const SESSION_HANDLE sessioncontext, const BID_SEIDSDO *sdo, char **sdoxml) |
BIDCSERVER_API int BIDCALLCONV | BID_DynamicSDOValidate (const SESSION_HANDLE sessioncontext, const BID_SEIDSDO *sdo, const char *data, const int numsignatures, const int sealcheck) |
BIDCSERVER_API int BIDCALLCONV | BID_SDOValidate (const SESSION_HANDLE sessioncontext, const BID_SEIDSDO *sdo, const int verifydata) |
BIDCSERVER_API int BIDCALLCONV | BID_SDOXMLValidate (const SESSION_HANDLE sessioncontext, const char *sdo, const int verifydata) |
BIDCSERVER_API int BIDCALLCONV | BID_SDOFree (const SESSION_HANDLE sessioncontext, BID_SEIDSDO *sdo) |
BIDCSERVER_API int | BID_SignaturesFree (const SESSION_HANDLE sessioncontext, BID_Signature *signature) |
BIDCSERVER_API int BIDCALLCONV | BID_SDOAddData (const SESSION_HANDLE sessioncontext, BID_SEIDSDO *sdo, const char *data) |
BIDCSERVER_API int BIDCALLCONV | BID_SDOSeal (const SESSION_HANDLE sessioncontext, BID_SEIDSDO *sdo, const char *ocsp, const char *data) |
BIDCSERVER_API int BIDCALLCONV | BID_SDOAddSignature (const SESSION_HANDLE sessioncontext, BID_SEIDSDO *sdo, const BID_Signature *signatures, const char *data) |
BIDCSERVER_API int BIDCALLCONV | BID_Free (char *allocated) |
BIDCSERVER_API int BIDCALLCONV | BID_GetRecentError (const SESSION_HANDLE sessioncontext, char **error) |
BIDCSERVER_API int BIDCALLCONV | BID_XMLToSDOEx (const SESSION_HANDLE sessioncontext, const char *sdoxml, BID_SEIDSDO **sdo) |
BIDCSERVER_API int BIDCALLCONV | BID_CreateSecureChannel (const SESSION_HANDLE sessioncontext, const char *pkcs7, char **channelpkcs7, char **channeldata) |
BIDCSERVER_API int BIDCALLCONV | BID_AssymetricDecrypt (const SESSION_HANDLE sessioncontext, const char *keylocation, const char *password, const char *encrypted, char **decrypted) |
BIDCSERVER_API int BIDCALLCONV | BID_GetCertStatusWithNonce (const SESSION_HANDLE sessioncontext, const char *pkcs7, char **ocspresponse, char **nonce) |
BIDCSERVER_API int BIDCALLCONV | BID_GetSessionStoreInfo (const SESSION_HANDLE sessioncontext, BID_SessionInfo **sessioninfo) |
BIDCSERVER_API int BIDCALLCONV | BID_FreeSessionStoreInfo (const SESSION_HANDLE sessioncontext, BID_SessionInfo *sessioninfo) |
BIDCSERVER_API int BIDCALLCONV | BID_RequestMobileAction (const SESSION_HANDLE sessioncontext, char **transactionreference) |
BIDCSERVER_API int BIDCALLCONV | BID_PushSms (const SESSION_HANDLE sessioncontext, const char *transactionreference, const char *text) |
BIDCSERVER_API int BIDCALLCONV | BID_GetSigners (const SESSION_HANDLE sessioncontext, BID_Signature *signatures, char **signers) |
BIDCSERVER_API int BIDCALLCONV | BID_DynamicSDOGetSigners (const SESSION_HANDLE sessioncontext, const BID_SEIDSDO *sdo, char **signers) |
BIDCSERVER_API int BIDCALLCONV | BID_DynamicSDOXMLGetSigners (const SESSION_HANDLE sessioncontext, const char *sdo, char **signers) |
BIDCSERVER_API int BIDCALLCONV | BID_SimpleDynamicSDOXMLValidate (const SESSION_HANDLE sessioncontext, const char *sdo, const int minnumsignatures) |
BIDCSERVER_API int BIDCALLCONV | BID_RequestMobileStatus (const SESSION_HANDLE sessioncontext, const char *transactionreference, char **transactionstatus) |
BIDCSERVER_API int BIDCALLCONV | BID_GenerateMerchantReference (const int sessioncontext, const char *locale, char **merchantreference) |
BIDCSERVER_API int BIDCALLCONV | BID_DecryptTransactionData (const int sessioncontext, const char *enckey, const char *encdata, const char *encauth, const char *operation, const char *sid, char **data, char **key) |
BIDCSERVER_API int BIDCALLCONV | BID_InitTransaction (const int sessioncontext, const char *enckey, const char *encdata, const char *encauth, const char *operation, const char *sid, char **response) |
BIDCSERVER_API int BIDCALLCONV | BID_VerifyTransactionRequest (const int sessioncontext, const char *enckey, const char *encdata, const char *encauth, const char *operation, const char *sid) |
BIDCSERVER_API int BIDCALLCONV | BID_VerifyTransactionResponse (const int sessioncontext, char **response) |
BIDCSERVER_API int BIDCALLCONV | BID_SDOXMLExtractSignatures (const int sessioncontext, const char *sdoxml, char **data, char **datatype, char **datadescription, BID_Signature **signatures) |
BIDCSERVER_API int BIDCALLCONV | BID_GetTransactionInfo (const int sessioncontext, const char *key, const char *oids, const char *timeout) |
BIDCSERVER_API int BIDCALLCONV | BID_InitSession (const int sessioncontext, char **helperuri, char **traceid, char **clientid) |
BIDCSERVER_API int BIDCALLCONV | BID_GetVersionInfo (char **versioninfo) |
BIDCSERVER_API int BIDCALLCONV | BID_AddDocumentText (const int sessioncontext, const char *data, const char *dataDescription) |
BIDCSERVER_API int BIDCALLCONV | BID_AddDocumentXML (const int sessioncontext, const char *xml, const char *xsl, const char *dataDescription) |
BIDCSERVER_API int BIDCALLCONV | BID_AddDocumentPDF (const int sessioncontext, const char *data, const char *dataDescription) |
BIDCSERVER_API int BIDCALLCONV | BID_AddDocumentPDFSerialSign (const int sessioncontext, const char *data, const char *dataDescription, BID_SerialSigningKind kind, BID_VisualSealPosition *merchant_seal_position, BID_VisualSealPosition *end_user_seal_position) |
BIDCSERVER_API int BIDCALLCONV | BID_InitTransactionSelfAssembler (const int sessioncontext, const char *enc_key, const char *enc_data, const char *enc_auth, const char *operation, const char *sid, BID_VisualSealBuilder merchant_visual_seal_builder, char **response) |
BIDCSERVER_API int BIDCALLCONV | BID_InitSignBuildEndUserSeal (const int sessioncontext, const char *enckey, const char *encdata, const char *encauth, const char *operation, const char *sid, BID_VisualSealBuilder end_user_visual_seal_builder, char **response) |
BIDCSERVER_API int BIDCALLCONV | BID_InitSignSignMerchantSeal (const int sessioncontext, const char *enckey, const char *encdata, const char *encauth, const char *operation, const char *sid, char **response) |
BIDCSERVER_API int BIDCALLCONV | BID_VerifySignAddDSS (const int sessioncontext, const char *enckey, const char *encdata, const char *encauth, const char *operation, const char *sid, char **response) |
BIDCSERVER_API int BIDCALLCONV | BID_VerifyTransactionRequestSelfAssembler (const int sessioncontext, const char *enckey, const char *encdata, const char *encauth, const char *operation, const char *sid, BID_ValidationBuilder validation_increment_builder) |
BIDCSERVER_API int BIDCALLCONV | BID_GetSerialSignedData (const int sessioncontext, const int docnum, BID_SerialSigningData **serial_signing_data) |
BIDCSERVER_API int BIDCALLCONV | BID_GetSerialSignedPdf (const int sessioncontext, const int docnum, char **pdfDataB64) |
BIDCSERVER_API int BIDCALLCONV | BID_SetSerialSignedData (const int sessioncontext, const BID_SerialSigningData *serial_signing_data) |
BIDCSERVER_API int BIDCALLCONV | BID_Free_SerialSigningData (BID_SerialSigningData *allocated) |
BIDCSERVER_API int BIDCALLCONV | BID_GetSignedData (const int sessioncontext, const int docnum, char **signed_data, char **signature) |
BIDCSERVER_API int BIDCALLCONV | BID_SetSignedData (const int sessioncontext, const char *data) |
BIDCSERVER_API int BIDCALLCONV | BID_GetSignatureAndOCSP (const int sessioncontext, const int docnum, char **signature, char **ocsp) |
BIDCSERVER_API int BIDCALLCONV | BID_GetSignatureAndFullOCSP (const int sessioncontext, const int docnum, char **signature, char **fullocsp) |
BIDCSERVER_API int BIDCALLCONV | BID_GetReportData (const int sessioncontext, const char *key, char **out) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_gap_start_index (BID_ByteRange const *b, int *out) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_gap_offset (BID_ByteRange const *b, int *out) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_gap_len (BID_ByteRange const *b, int *out) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_len_excl_gap (BID_ByteRange const *b, int *out) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_len_incl_gap (BID_ByteRange const *b, int *out) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_set (BID_ByteRange *br, int low0, int len0, int low1, int len1) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_set_simple (BID_ByteRange *br, int len) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_set_offset (BID_ByteRange *br, BID_ByteRange const *src, int len) |
BIDCSERVER_API int BIDCALLCONV | BID_Byterange_set_empty (BID_ByteRange *br) |
BIDCSERVER_API void BIDCALLCONV | BID_Brwd_free (BID_ByteRangeWithData *br) |
BIDCSERVER_API BID_ByteRangeWithData *BIDCALLCONV | BID_Brwd_create (unsigned char *data, BID_ByteRange const *br) |
BIDCSERVER_API BID_ByteRangeWithData *BIDCALLCONV | BID_Brwd_create_copy (BID_ByteRangeWithData *brwd) |
BIDCSERVER_API BID_ByteRangeWithData *BIDCALLCONV | BID_Brwd_create_simple (unsigned char *data, int len) |
BIDCSERVER_API BID_ByteRangeWithData *BIDCALLCONV | BID_Brwd_create_empty () |
BIDCSERVER_API BID_ByteRangeWithData *BIDCALLCONV | BID_Brwd_concat (BID_ByteRangeWithData *first, BID_ByteRangeWithData *second) |
BIDCSERVER_API BID_ByteRangeWithData *BIDCALLCONV | BID_Brwd_get_data_without_gap (BID_ByteRangeWithData *brwd) |
BIDCSERVER_API BID_ByteRangeWithData *BIDCALLCONV | BID_Brwd_strip_off_prefix (BID_ByteRangeWithData *brwd, int prefixlen) |
BIDCSERVER_API int BIDCALLCONV | BID_Brwd_insert_signature_in_gap (BID_ByteRangeWithData *dest, unsigned char *data, int data_len) |
#define BIDCALLCONV __cdecl |
#define BIDCSERVER_API __declspec(dllimport) |
typedef int SESSION_HANDLE |
BIDCSERVER_API int BIDCALLCONV BID_AddDocumentPDF | ( | const int | sessioncontext, |
const char * | data, | ||
const char * | dataDescription | ||
) |
BID_AddDocumentPDF is used to add a pdf document to be signed in BankID 2.1, it should not be used for serial signing
sessioncontext | The context handle for the current merchant |
data | The bytes of the pdf to be signed. |
dataDescription | The description of the document |
BIDCSERVER_API int BIDCALLCONV BID_AddDocumentPDFSerialSign | ( | const int | sessioncontext, |
const char * | data, | ||
const char * | dataDescription, | ||
BID_SerialSigningKind | kind, | ||
BID_VisualSealPosition * | merchant_seal_position, | ||
BID_VisualSealPosition * | end_user_seal_position | ||
) |
BID_AddDocumentPDF is used to add a pdf document to be signed in BankID 2.1 using serial signing When doing serial signing there should be only PDFs and they should all be signed serially. For selfassembler mode, the seal_positions should be set to tell the BankID ClientProxy server what page to refresh when seals are placed.
sessioncontext | The context handle for the current merchant |
data | The bytes of the pdf to be signed as a B64 String |
dataDescription | The description of the document |
kind | The kind of serial signing to do, BID_SERIAL or BID_SERIAL_END_USER_ONLY |
merchant_seal_position | where to place the seal or null if default values shall be used |
end_user_seal_position | where to place the seal or null if default values shall be used |
BIDCSERVER_API int BIDCALLCONV BID_AddDocumentText | ( | const int | sessioncontext, |
const char * | data, | ||
const char * | dataDescription | ||
) |
BID_AddDocumentText is used to add a text document to be signed in BankID 2.1
sessioncontext | The context handle for the current merchant |
data | The bytes of the document to be signed in base 64 format |
dataDescription | The dataDescription for the document to be signed |
BIDCSERVER_API int BIDCALLCONV BID_AddDocumentXML | ( | const int | sessioncontext, |
const char * | xml, | ||
const char * | xsl, | ||
const char * | dataDescription | ||
) |
BID_AddDocumentXML is used to add a xml document to be signed in BankID 2.1
sessioncontext | The context handle for the current merchant |
xml | The xml bytes to be signed |
xsl | The xsl transformation to be applied to the xml (for viewing) |
dataDescription | The description of the document |
BIDCSERVER_API int BIDCALLCONV BID_AssymetricDecrypt | ( | const SESSION_HANDLE | sessioncontext, |
const char * | keylocation, | ||
const char * | password, | ||
const char * | encrypted, | ||
char ** | decrypted | ||
) |
BID_AssymetricDecrypt decrypts PKCS#8 encoded data using the passed private key.
sessioncontext | This is the context handle for the current merchant |
keylocation | This is the location of the PKCS#8 private key. |
password | The password for the PKCS#8 private key. |
encrypted | Encrypted data |
decrypted | Decrypted data |
BIDCSERVER_API int BIDCALLCONV BID_AuthenticateClient | ( | const SESSION_HANDLE | sessioncontext, |
const char * | pkcs7, | ||
const char * | serverchallenge | ||
) |
BID_AuthenticateClient verifies a PKCS#7 retrieved from the client during the authentication process.
sessioncontext | This is the context handle for the current merchant |
pkcs7 | This is a BASE64 encoded PKCS#7 structure to verify. |
serverchallenge | The data that apparently is signed when the PKCS#7 signature was created. During an authentication procedure the signed data is the challenge created earlier by the BankID C Server using BID_AuthenticateServer. |
BIDCSERVER_API int BIDCALLCONV BID_AuthenticateServer | ( | const SESSION_HANDLE | sessioncontext, |
char ** | pkcs7, | ||
char ** | serverchallenge, | ||
const char * | clientchallenge, | ||
const char * | authenticationheader, | ||
const char * | prepareText | ||
) |
BID_AuthenticateServer creates a signature on behalf of the server that is proprietary to the authentication mechanism.
sessioncontext | This is the context handle for the current merchant |
pkcs7 | This is a reference to a pointer where BankID C Server will allocate memory and fill in a BASE64 encoded PKCS#7 |
serverchallenge | This is a reference to a pointer whereBankID C Server will allocate memory and fill in a generated serverchallenge |
clientchallenge | This is an incoming clientchallenge generated by the client BankID Applet. The signature is created based on these data. |
authenticationheader | The authentication header received from the COI if the BankID operation is triggered by a mobile phone |
prepareText | The prepareText value received from the COI if the BankID operation is triggered by a mobile phone |
BIDCSERVER_API int BIDCALLCONV BID_Base64Decode | ( | const SESSION_HANDLE | sessioncontext, |
const char * | in, | ||
unsigned char ** | out, | ||
size_t * | outlen | ||
) |
BID_Base64Encode basically BASE64 decodes the incoming data.
sessioncontext | This is the context handle for the current merchant |
in | This is the incoming BASE64 encoded data to decode. |
out | This is a reference to a pointer where BankID C Server will allocate memory and fill in the BASE64 decoded data |
outlen | This is the length of the BASE64 decoded data. |
BIDCSERVER_API int BIDCALLCONV BID_Base64Encode | ( | const SESSION_HANDLE | sessioncontext, |
const unsigned char * | in, | ||
const size_t | inlen, | ||
char ** | out | ||
) |
BID_Base64Encode basically BASE64 encodes the incoming data.
sessioncontext | This is the context handle for the current merchant |
in | This is the incoming data to encode |
inlen | This is the length of the incoming data |
out | This is a reference to a pointer where BankID C Server will allocate memory and fill in the BASE64 encoded data. |
BIDCSERVER_API BID_ByteRangeWithData* BIDCALLCONV BID_Brwd_concat | ( | BID_ByteRangeWithData * | first, |
BID_ByteRangeWithData * | second | ||
) |
BID_Brwd_concat is used to join to byteranges into a new freshly allocated
Byteranges must be concatenable, i.e. second must start at end of first byterange, or one or both shall be empty. Will allocate a new byterange with data, allocates its data element big enough to hold the sum of first and second. The resulting byterange will start at first's low0 and end at seconds low1 + len1, gap preserved will be seconds gap. If either first or second is empty, the result with be the other.
Result should be freed using bid_brwd_free.
first | the "leftmost" byte range with data, should not be null |
second | the "rightmont" byte range with data, must strictly follow first or either be null or empty. |
BIDCSERVER_API BID_ByteRangeWithData* BIDCALLCONV BID_Brwd_create | ( | unsigned char * | data, |
BID_ByteRange const * | br | ||
) |
BID_Brwd_create is used to create a byterange with data. It copies both data
and br
.
data | pointer to data to hold |
br | byterange describing data, bid_byterange_len_incl_gap(br) should equal length of data |
BIDCSERVER_API BID_ByteRangeWithData* BIDCALLCONV BID_Brwd_create_copy | ( | BID_ByteRangeWithData * | brwd | ) |
BID_Brwd_create_copy is used to create a copy of another byterange, i.e. allocate memory and copy content
brwd | byterange with data to take a copy of, != NULL |
BIDCSERVER_API BID_ByteRangeWithData* BIDCALLCONV BID_Brwd_create_empty | ( | ) |
BID_Brwd_create_empty is used to create an empty byterange with data
An empty byterange may be concatenated commutatively with any other byterange X, the result is X. Holds no data.
BIDCSERVER_API BID_ByteRangeWithData* BIDCALLCONV BID_Brwd_create_simple | ( | unsigned char * | data, |
int | len | ||
) |
BID_Brwd_create_simple is used to create a byterange with data holding some data with a given length
data | pointer to data to hold |
len | length of data |
BIDCSERVER_API void BIDCALLCONV BID_Brwd_free | ( | BID_ByteRangeWithData * | br | ) |
BID_Brwd_free is used to free memory allocated by a byterange with data
Frees memory for data element, then frees memory for the byterange itself.
br | the reference to the byterange to be freed, if null, no action |
BIDCSERVER_API BID_ByteRangeWithData* BIDCALLCONV BID_Brwd_get_data_without_gap | ( | BID_ByteRangeWithData * | brwd | ) |
BID_Brwd_get_data_without_gap is used to join the first and second array of bytes described by a byterange into one.
This function is used to extract the data to be signed out of a byterange with data structure. The result is again a byterange with data structure where the right part has zero length and the left part has length byterange_len_excl_gap(brwd->byte_range).
Result should be freed using bid_brwd_free. It always copies the data, even if there is no gap in brwd.
brwd | the byterange with data to handle |
BIDCSERVER_API int BIDCALLCONV BID_Brwd_insert_signature_in_gap | ( | BID_ByteRangeWithData * | dest, |
unsigned char * | data, | ||
int | data_len | ||
) |
BID_Brwd_insert_signature_in_gap is used to insert a signature (pkcs7 DER encoding) into a byterange with data's gap area.
This method is mostly for internal usage. The length of the byterange with data's gap should be at least twice data_len since signature will be written hexEncoded, see details at http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf page 476
brwd | the byterange with data to handle |
data | pkcs7 data to insert, |
data_len | number of bytes in pkcs7 |
BIDCSERVER_API BID_ByteRangeWithData* BIDCALLCONV BID_Brwd_strip_off_prefix | ( | BID_ByteRangeWithData * | brwd, |
int | prefixlen | ||
) |
BID_Brwd_strip_off_prefix is used to remove an initial part from a byte range with data
Result should be freed using bid_brwd_free.
brwd | the byterange with data to handle |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_gap_len | ( | BID_ByteRange const * | b, |
int * | out | ||
) |
BID_Byterange_gap_len is used to get the length between end of first dataelement and start of second.
b | the byterange to use |
out | b.low1 - (b.low0 + b.len0) |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_gap_offset | ( | BID_ByteRange const * | b, |
int * | out | ||
) |
BID_Byterange_gap_offset is used to get the offset of the gap internal to the byterange
b | the byterange to use |
out | b.len0 unless an error occurs |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_gap_start_index | ( | BID_ByteRange const * | b, |
int * | out | ||
) |
BID_Byterange_gap_start_index is used to get the byterange's offseted index of byterange's gap
b | the byterange to use |
out | b.low0 + b.len0 unless an error occurs |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_len_excl_gap | ( | BID_ByteRange const * | b, |
int * | out | ||
) |
BID_Byterange_len_excl_gap is used to get the length of the databuffer minus length of an eventual gap
b | the byterange to use |
out | b.len0 + b.len1 unless an error occurs |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_len_incl_gap | ( | BID_ByteRange const * | b, |
int * | out | ||
) |
BID_Byterange_len_incl_gap is used to get the length of whole databuffer
b | the byterange to use |
out | bid_byterange_len_excl_gap(b) + bid_byterange_gap_len(b) unless an error occurs |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_set | ( | BID_ByteRange * | br, |
int | low0, | ||
int | len0, | ||
int | low1, | ||
int | len1 | ||
) |
BID_ByteRange_set is used to set values into a provided byterange structure. The range will be normalized
Normalizing a byterange sets the byterange to all zeroes if both length are zero. Normalizing a byterange moves the second part to the first part if length of first is zero and gap is zero. len1 will be set to zero.
There is no memory allocation here.
br | The byterange to modify |
low0 | index of first part in byterange, >= 0 |
len0 | length of first part, >= 0 |
low1 | index of second part of byterange, >= low0 + len0 |
len1 | length of second part, >= 0 |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_set_empty | ( | BID_ByteRange * | br | ) |
BID_Byterange_set_empty is used to set a byterange to all zeros
An empty byterange may be concatenated commutatively with any other byterange X, the result is X.
br | The byterange to modify |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_set_offset | ( | BID_ByteRange * | br, |
BID_ByteRange const * | src, | ||
int | len | ||
) |
BID_Byterange_set_offset is used to turn one byterange into a copy of another, offset by a given number
br | The byterange to modify |
src | Source byterange |
len | length to offset the src |
BIDCSERVER_API int BIDCALLCONV BID_Byterange_set_simple | ( | BID_ByteRange * | br, |
int | len | ||
) |
BID_ByteRange_set_simple is used to set a byterange to a given length. Equivalent to bid_byterange_set(br, 0, len, len, 0)
.
br | The byterange to modify |
len | length of data to hold |
BIDCSERVER_API int BIDCALLCONV BID_CloseSession | ( | SESSION_HANDLE | sessioncontext | ) |
BID_CloseSession must be called for every merchant that wants to take down a merchantsession towards the library. When BID_CloseSession returns no more actions must be taken towards the library with the closes dession handle..
sessioncontext | This is the reference to the merchant's session |
BIDCSERVER_API int BIDCALLCONV BID_CreateDynamicSDO | ( | const SESSION_HANDLE | sessioncontext, |
BID_SEIDSDO ** | sdo, | ||
const char * | data, | ||
const char * | datatype, | ||
const char * | datadescription, | ||
const BID_Signature * | signatures | ||
) |
BID_CreateDynamicSDO creates an unsealed SDO. The SDO will consist of all signatures applied in the function call. The data itself will not be embedded in the SDO. The merchant must call BID_SEIDSDOAddData to embed the data in the SDO. The SDO will not be sealed. The merchant must call BID_SealSDO to seal all signatures.
sessioncontext | This is the context handle for the current merchant |
sdo | This a reference to a pointer to a BID_SEIDSDO structure where BankID C Server will allocate memory and fill in the SDO. |
data | This is the data (the contract) itself. |
datatype | The datatype of the signed data This must be either SDODATA_TEXT or SDODATA_PDF. |
datadescription | The datadescription of the signed data. |
signatures | The list of all signatures that will be embedded in the SDO. |
BIDCSERVER_API int BIDCALLCONV BID_CreateSDO | ( | const SESSION_HANDLE | sessioncontext, |
BID_SEIDSDO ** | sdo, | ||
const char * | data, | ||
const char * | datatype, | ||
const char * | datadescription, | ||
const char * | clientpkcs7, | ||
const char * | serverpkcs7, | ||
const char * | clientocspresponse, | ||
const char * | serverocspresponse | ||
) |
BID_CreateSDO creates a Signed Data Object that is a mutual contract between a merchant and an end user. The data itself will not be embedded in the SDO. The merchant must call BID_SEIDSDOAddData to embed the data in the SDO.
sessioncontext | This is the context handle for the current merchant |
sdo | This a reference to a pointer to a BID_SEIDSDO structure where BankID C Server will allocate memory and fill in the SDO. |
data | This is the data (the contract) itself. |
datatype | The datatype of the signed data This must be either SDODATA_TEXT or SDODATA_PDF. |
datadescription | The datadescription of the signed data. |
clientpkcs7 | This is a BASE64 encoded client PKCS#7 apparently containing a signature over the incoming data. |
serverpkcs7 | This is a BASE64 encoded serverPKCS#7 apparently containing a signature over the incoming data. |
clientocspresponse | This is a BASE64 encoded OCSP response from an earlier BID_GetCertStatus request for the clients certificate. Set the parameter to NULL if no OCSP response is supplied If supplied and all constraints are satisfied no VA lookup on client certificate will be done. |
serverocspresponse | This is a BASE64 encoded OCSP response from an earlier BID_GetCertStatus request for the server certificate. Set the parameter to NULL if no OCSP response is supplied If supplied and all constraints are satisfied no VA lookup on server certificate will be done. |
BIDCSERVER_API int BIDCALLCONV BID_CreateSecureChannel | ( | const SESSION_HANDLE | sessioncontext, |
const char * | pkcs7, | ||
char ** | channelpkcs7, | ||
char ** | channeldata | ||
) |
BID_CreateSecureChannel is used by the merchant to create a message directly to the COI. The channel is at present used to inform the COI about the demands currently set on the client. If the merchant demands that the client enteres a new OTP for the current transaction this function, The messages (key,value) are set by calling BID_SetInfoItem prior to calling this method.
sessioncontext | This is the context handle for the current merchant |
pkcs7 | The merchants own pkcs7 for the current transaction. |
channelpkcs7 | The signed channel |
channeldata | The channeldata that was signed |
BIDCSERVER_API int BIDCALLCONV BID_CreateXMLDSIG | ( | const SESSION_HANDLE | sessioncontext, |
const char * | c14nxmlorder, | ||
char ** | xmldsig, | ||
int * | certexpiresin | ||
) |
BID_CreateXMLDSIG creates an enveloping XMLDSIG structure.
sessioncontext | This is the context handle for the current merchant |
c14nxmlorder | A c14n canonicalized ODS order wrapped in an "Object" element. |
xmldsig | This is a reference to a pointer where BankID C Server will alloate memory and store the XMLDSIG structure. |
certexpiresin | This is a reference to a pointer where BankID C Server will store how many days it is until the certificate expires. |
BIDCSERVER_API int BIDCALLCONV BID_DecryptTransactionData | ( | const int | sessioncontext, |
const char * | enckey, | ||
const char * | encdata, | ||
const char * | encauth, | ||
const char * | operation, | ||
const char * | sid, | ||
char ** | data, | ||
char ** | key | ||
) |
BID_DecryptTransactionData can be used by the merchant to decrypt the transaction data used during BankID communication, both the request from the client and the response genererated by BankID Server.
sessioncontext | This is the context handle for the current merchant |
enckey | The encryption key |
encdata | The encrypted data |
encauth | The MAC of the encrypted data |
operation | The operation parameter |
sid | The sid |
data | The decrypted data |
key | The key to use for communication |
BIDCSERVER_API int BIDCALLCONV BID_DynamicSDOGetSigners | ( | const SESSION_HANDLE | sessioncontext, |
const BID_SEIDSDO * | sdo, | ||
char ** | signers | ||
) |
BID_DynamicSDOGetSigners retrieves the signers of the SEIDSDO SDO structure. The output string is semicolon separated and used by the netcentric client during the multisigning process.
sessioncontext | This is the context handle for the current merchant. |
sdo | This is the SDO that should contain the singatures |
signers | The string containing information about the signers |
BIDCSERVER_API int BIDCALLCONV BID_DynamicSDOValidate | ( | const SESSION_HANDLE | sessioncontext, |
const BID_SEIDSDO * | sdo, | ||
const char * | data, | ||
const int | numsignatures, | ||
const int | sealcheck | ||
) |
BID_SDODynamicValidate will validate an SDO. If the data itself should be verified the verifydata flag must be set.
sessioncontext | This is the context handle for the current merchant |
sdo | This is the constructed SDO structure. |
data | This is the data (the contract) itself. |
numsignatures | The expected number of signatures in the SDO. |
sealcheck | 0: Must be present and verified 1: Must not be present, 2: Can be present, verify if present. |
BIDCSERVER_API int BIDCALLCONV BID_DynamicSDOXMLGetSigners | ( | const SESSION_HANDLE | sessioncontext, |
const char * | sdo, | ||
char ** | signers | ||
) |
BID_DynamicSDOXMLGetSigners retrieves the signers of the SEIDSDO XML. The output string is semicolon separated and used by the netcentric client during the multisigning process.
sessioncontext | This is the context handle for the current merchant. |
sdo | This is the SDO XML that should contain the singatures |
signers | The string containing information about the signers |
BIDCSERVER_API int BIDCALLCONV BID_Finalize | ( | ) |
BID_Finalize cleans up the BankID resources. It is called after all sessions are closed.
BIDCSERVER_API int BIDCALLCONV BID_Free | ( | char * | allocated | ) |
BID_Free frees memory allocated by BankID C Server.
allocated | This is a pointer to data previosly allocated by BankID C Server. |
BIDCSERVER_API int BIDCALLCONV BID_Free_SerialSigningData | ( | BID_SerialSigningData * | allocated | ) |
BID_Free_SerialSigningData frees memory allocated by BankID C Server.
allocated | This is a pointer to data previosly allocated by BankID C Server. |
BIDCSERVER_API int BIDCALLCONV BID_FreeSessionStoreInfo | ( | const SESSION_HANDLE | sessioncontext, |
BID_SessionInfo * | sessioninfo | ||
) |
BID_FreeSessionStoreInfo freees the sessionstoreinfo structure list.
sessioncontext | This is the context handle for the current merchant. |
sessioninfo | The linked list to free. |
BIDCSERVER_API int BIDCALLCONV BID_GenerateMerchantReference | ( | const int | sessioncontext, |
const char * | locale, | ||
char ** | merchantreference | ||
) |
BID_GenerateMerchantReference generates the reference to show to the user during mobile authentication.
sessioncontext | This is the context handle for the current merchant |
locale | The locale to use. Supported values: no_NO, en_GB |
merchantreference | This is text to be displayed to the user on the merchant site |
BIDCSERVER_API int BIDCALLCONV BID_GetCertStatus | ( | const SESSION_HANDLE | sessioncontext, |
const char * | pkcs7, | ||
char ** | ocspresponse | ||
) |
BID_GetCertStatus accepts a PKCS#7 structure, retrieves the signing certificate and requests a certificate status towards the Validation Authority. If a pcks#7 is not present in the call, a VA lookup on the merchant itself is done.
sessioncontext | This is the context handle for the current merchant |
pkcs7 | This is the BASE64 encoded signature in which the certificate in request resides. |
ocspresponse | This is a reference to a pointer where BankID C Server will allocate storage and fill in the OCSP response from the VA. If the parameter is NULL, the OCSP response will not be supplied. |
BIDCSERVER_API int BIDCALLCONV BID_GetCertStatusWithNonce | ( | const SESSION_HANDLE | sessioncontext, |
const char * | pkcs7, | ||
char ** | ocspresponse, | ||
char ** | nonce | ||
) |
BID_GetCertStatusWithNonce accepts a PKCS#7 structure, retrieves the signing certificate and requests a certificate status towards the Validation Authority. If a pcks#7 is not present in the call, a VA lookup on the merchant itself is done.
sessioncontext | This is the context handle for the current merchant |
pkcs7 | This is the BASE64 encoded signature in which the certificate in request resides. |
ocspresponse | This is a reference to a pointer where BankID C Server will allocate storage and fill in the OCSP response from the VA. |
nonce | This is a reference to a pointer where BankID C Server will allocate storage and fill in the OCSP request nonce sent to the VA. If the parameter is NULL, the OCSP response will not be supplied. |
BIDCSERVER_API int BIDCALLCONV BID_GetInfoItem | ( | const SESSION_HANDLE | sessioncontext, |
const char * | key, | ||
char ** | value | ||
) |
BID_GetInfoItem is used by the merchant to retrieve a value stored in the merchants session under the corresponding key.
sessioncontext | This is the context handle for the current merchant |
key | This is the key for where to find the value. |
value | This is a reference to a pointer where BankID C Server will allocate memory and fill in the value for the requested key. |
BIDCSERVER_API int BIDCALLCONV BID_GetOwnCertStatus | ( | const SESSION_HANDLE | sessioncontext, |
char ** | ocspresponse | ||
) |
BID_GetOwnCertStatus will do a Validation Authority lookup on the merchants own signing certificate.
sessioncontext | This is the context handle for the current merchant |
ocspresponse | This is a reference to a pointer where BankID C Server will allocate storage and fill in the OCSP response from the VA. If the parameter is NULL, the OCSP response will not be supplied. |
BIDCSERVER_API int BIDCALLCONV BID_GetPKCS7Info | ( | const SESSION_HANDLE | sessioncontext, |
const char * | pkcs7, | ||
const int | infoitem, | ||
char ** | out | ||
) |
BID_GetPKCS7Info is a method for retrieving the specified information item from a PKCS#7 structure.
sessioncontext | This is the context handle for the current merchant |
pkcs7 | This a BASE64 encoded PKCS#7 structure to retrieve information from. |
infoitem | This is the requested information item. The valid items are: ISSUERNAME, SUBJECTNAME, VALIDFROMDATE, VALIDTODATE, VERSIONNUMBER, SERIALNUMBER, KEYALGORITHM, KEYSIZE, UNIQUEID, ORIGINATOR, BANKNAME, DATEOFBIRTH, POLICYOID |
out | This is a reference to a pointer where BankID C Server will allocate memory and fill the requested dataitem. |
BIDCSERVER_API int BIDCALLCONV BID_GetRandom | ( | const SESSION_HANDLE | sessioncontext, |
char ** | rand, | ||
const size_t | randlen | ||
) |
BID_GetRandom creates the specified length of random bytes.
sessioncontext | This is the context handle for the current merchant |
rand | This is a reference to a pointer where BankID C Server will allocate memory and fill in the random data. |
randlen | This parameter specifies how many random bytes that must be generated. |
BIDCSERVER_API int BIDCALLCONV BID_GetRecentError | ( | const SESSION_HANDLE | sessioncontext, |
char ** | error | ||
) |
BID_GetRecentError.
sessioncontext | This is the context handle for the current merchant |
error | This a reference to a char pointer with a description of the very last error that occured in BankID Server. |
BIDCSERVER_API int BIDCALLCONV BID_GetReportData | ( | const int | sessioncontext, |
const char * | key, | ||
char ** | out | ||
) |
BID_GetReportData is used to fetch the new report elements from bankid server. Data returned from this method is UTF-8 encoded.
sessioncontext | This is the context handle for the current merchant |
key | The key to request data for. |
out | The data is returned here. |
BIDCSERVER_API int BIDCALLCONV BID_GetSerialSignedData | ( | const int | sessioncontext, |
const int | docnum, | ||
BID_SerialSigningData ** | serial_signing_data | ||
) |
BID_GetSerialSignedData is used to get the signed data and the incremental updates for a signed document in BankID 2.1. The method acts the same as BID_GetSignedData but gets the serial_signing_data instead. It's purpose is to make it possible to hold these data between the different callbacks from webclient.
sessioncontext | This is the context handle for the current merchant. |
docnum | The number of the document to fetch signed data for. 0 is the first document. |
serial_signing_data | copy of serial signing data so far, data inside this element should be freed using BID_Free_SerialSigningData() |
BIDCSERVER_API int BIDCALLCONV BID_GetSerialSignedPdf | ( | const int | sessioncontext, |
const int | docnum, | ||
char ** | pdfDataB64 | ||
) |
BID_GetSerialSignedPdf is used to get the complete serial signed pdf document.
sessioncontext | This is the context handle for the current merchant |
docnum | The number of the document to fetch signed data for. 0 is the first document. this must be a serial signed document |
pdfDataB64 | Pointer to a char which holds the result. Should be freed by BID_Free |
BIDCSERVER_API int BIDCALLCONV BID_GetSessionStoreInfo | ( | const SESSION_HANDLE | sessioncontext, |
BID_SessionInfo ** | sessioninfo | ||
) |
BID_GetSessionStoreInfo extracts key information about all registered sessions for the BankID Server runtime.
sessioncontext | This is the context handle for the current merchant. |
sessioninfo | this is a linked list of all registered sessions with session information. |
BIDCSERVER_API int BIDCALLCONV BID_GetSignatureAndFullOCSP | ( | const int | sessioncontext, |
const int | docnum, | ||
char ** | signature, | ||
char ** | fullocsp | ||
) |
BID_GetSignatureAndFullOCSP is used to get client signature and full ocsp after a call to BID_VerifyTransactionRequest.
sessioncontext | This is the context handle for the current merchant |
docnum | The document number to fetch signature and ocsp for. 0 is the first document. |
signature | The client signature is returned here |
fullocsp | The client full ocsp is returned here |
BIDCSERVER_API int BIDCALLCONV BID_GetSignatureAndOCSP | ( | const int | sessioncontext, |
const int | docnum, | ||
char ** | signature, | ||
char ** | ocsp | ||
) |
BID_GetSignatureAndOCSP is used to get client signature and ocsp after a call to BID_VerifyTransactionRequest.
sessioncontext | This is the context handle for the current merchant |
docnum | The document number to fetch signature and ocsp for. 0 is the first document. |
signature | The client signature is returned here |
ocsp | The client ocsp is returned here |
BIDCSERVER_API int BIDCALLCONV BID_GetSignedData | ( | const int | sessioncontext, |
const int | docnum, | ||
char ** | signed_data, | ||
char ** | signature | ||
) |
BID_GetSignedData is used to get the signed data and the merchant signature for a signed document in BankID 2.1
sessioncontext | This is the context handle for the current merchant |
docnum | The number of the document to fetch signed data for. 0 is the first document. |
signed_data | The data was signed. |
signature | The merchant pkcs7 for this data. |
BIDCSERVER_API int BIDCALLCONV BID_GetSigners | ( | const SESSION_HANDLE | sessioncontext, |
BID_Signature * | signatures, | ||
char ** | signers | ||
) |
BID_GetSigners retrieves the signers from the linked list of signatures. The output string is semicolon separated and used by the netcentric client during the multisigning process.
sessioncontext | This is the context handle for the current merchant. |
signatures | The linked list of signatures to be parsed |
signers | The string containing information about the signers |
BIDCSERVER_API int BIDCALLCONV BID_GetTransactionInfo | ( | const int | sessioncontext, |
const char * | key, | ||
const char * | oids, | ||
const char * | timeout | ||
) |
BID_GetTransactionInfo is used to request additional information about a transaction.
sessioncontext | This is the context handle for the current merchant |
key | This is the transaction id to request information for |
oids | This is a comma separated list of oids that identify the information the merchant is allowed to request |
timeout | This is the maximum time to wait for data to become ready |
BIDCSERVER_API int BIDCALLCONV BID_GetVersionInfo | ( | char ** | versioninfo | ) |
BID_GetVersionInfo is used to get information about the BankID C Server library.
versioninfo | The version information is returned in this char** |
BIDCSERVER_API int BIDCALLCONV BID_HashData | ( | const SESSION_HANDLE | sessioncontext, |
char ** | hash, | ||
const int | hashalgorithm, | ||
const char * | data | ||
) |
BID_HashData creates a hash of the incoming data. The hashalgorithm to use is specified by the hashalgorithm parameter.
sessioncontext | This is the context handle for the current merchant |
hash | This is a reference to a pointer where BankID C Server will allocate memory and fill in the digest of the incoming data. |
hashalgorithm | This is either SHA1 or MD5, which are defined in this headerfile. |
data | This is the data that BankID C Server must create a digest of. |
BIDCSERVER_API int BIDCALLCONV BID_HashVerifyData | ( | const SESSION_HANDLE | sessioncontext, |
const char * | pkcs7, | ||
const char * | hash, | ||
const int | auth | ||
) |
BID_HashVerifyData verifies a PKCS#7 structure against incoming hashed data.
sessioncontext | This is the context handle for the current merchant |
pkcs7 | This is a BASE64 encoded PKCS#7 structure to verify. |
hash | The hash of the data that apparently is signed when the PKCS#7 signature was created This can be a usual string or raw bytes. |
auth | Is this a verification with signing or authentication certificate |
BIDCSERVER_API int BIDCALLCONV BID_HSMInitialize | ( | const char * | pkcs11driver | ) |
BID_Initialize is the first method a merchant must call in order to initialize the BankID C Server. The method initializes internal structures.
pkcs11driver | The full patth to the PKCS#11 implementation to be used. |
BIDCSERVER_API int BIDCALLCONV BID_HSMOpenSession | ( | SESSION_HANDLE * | sessioncontext, |
const char * | keylocation, | ||
const char * | password, | ||
const char * | configlocation, | ||
const char * | webaddress, | ||
const char * | tagcache, | ||
const char * | trustedstore, | ||
const char * | grantedpolicies, | ||
const char * | proxyserver, | ||
const char * | proxyport, | ||
const char * | pkcs11password, | ||
const int | slot | ||
) |
BID_HSMOpenSession must be called for every merchant that wants to create a merchantsession towards the library where the private keys are stored in a HSM. When BID_HSMOpenSession returns a context is created which must be used in all future calls for services.
sessioncontext | This is a reference to a variable where BankID C Server will store the context for the merchant |
keylocation | This must be the full path to the merchants keystore file. |
password | This is the password for the merchants keystore file. |
configlocation | This must contain the full path to the merchants configuration file, or NULL if not supplied |
webaddress | The web addresses and ip addresses used for MITM. |
tagcache | The full path to where to store cached tags. |
trustedstore | The full path to where the trusted ca certificates are located for ssl communication |
grantedpolicies | List of policyOIDs which are granted to be used with BankID Server. |
proxyserver | The ip address of an http proxy server. |
proxyport | The port of the http proxy server. |
pkcs11password | The password of the HSM where the keys reside |
slot | The slot in the hsm to use. |
BIDCSERVER_API int BIDCALLCONV BID_Initialize | ( | ) |
BID_Initialize is the first method a merchant must call in order to initialize the BankID C Server. The method initializes internal structures.
BIDCSERVER_API int BIDCALLCONV BID_InitSession | ( | const int | sessioncontext, |
char ** | helperuri, | ||
char ** | traceid, | ||
char ** | clientid | ||
) |
BID_InitSession is used to initialize a session between a merchant and a javascript client.
The following infoitems must be set before this method is invoked:
sessioncontext | This is the context handle for the current merchant |
helperuri | The source to be loaded in a separate iframe |
traceid | The traceid for this session. |
clientid | The clientid for the generated BankID 2.0 client. |
BIDCSERVER_API int BIDCALLCONV BID_InitSignBuildEndUserSeal | ( | const int | sessioncontext, |
const char * | enckey, | ||
const char * | encdata, | ||
const char * | encauth, | ||
const char * | operation, | ||
const char * | sid, | ||
BID_VisualSealBuilder | end_user_visual_seal_builder, | ||
char ** | response | ||
) |
BID_InitSignBuildEndUserSeal is used by the merchant in self assembling flow to create the merchant part incremental update of the document. the method is used for serial signed documents, may be called more than once pr. session. Should be called by merchant when operation equals "initSignBuildEndUserSeal" Note: Serial signing demands that cmsFormat "PKCS7_ISO320001" and ocspFormat OCSP_RFC6960_COMPATIBLE" is set in infoitems
sessioncontext | This is the context handle for the current merchant |
enckey | The encryption key |
encdata | The encrypted request |
encauth | The MAC of the encrypted data |
operation | The operation parameter sent from the BankID Client |
sid | The sid parameter sent from the BankID Client. |
end_user_visual_seal_builder | The callback to use to add the visual seal to the pdf serial documents, cannot be null, must be a valid function pointer |
response | The encrypted response |
BIDCSERVER_API int BIDCALLCONV BID_InitSignSignMerchantSeal | ( | const int | sessioncontext, |
const char * | enckey, | ||
const char * | encdata, | ||
const char * | encauth, | ||
const char * | operation, | ||
const char * | sid, | ||
char ** | response | ||
) |
BID_InitSignSignMerchantSeal is used by the merchant in turn key flow after the client has created the visual representation of the merchant seal. The method is used for serial signed documents, will be called at most once pr. session. Should be called by merchant when operation equals "initSignSignMerchantSeal" Note: Serial signing demands that cmsFormat "PKCS7_ISO320001" and ocspFormat OCSP_RFC6960_COMPATIBLE" is set in infoitems
sessioncontext | This is the context handle for the current merchant |
enckey | The encryption key |
encdata | The encrypted request |
encauth | The MAC of the encrypted data |
operation | The operation parameter sent from the BankID Client |
sid | The sid parameter sent from the BankID Client. |
response | The encrypted response |
BIDCSERVER_API int BIDCALLCONV BID_InitTransaction | ( | const int | sessioncontext, |
const char * | enckey, | ||
const char * | encdata, | ||
const char * | encauth, | ||
const char * | operation, | ||
const char * | sid, | ||
char ** | response | ||
) |
BID_InitTransaction is used by the merchant to create the encrypted response to the initAuth/Sign operation from the encrypted request of the BankID client. In addition to the encrypted response, a number of infoitems are available using BID_SetInfoItem(). See the the BankID C Server Interface Specification for the details.
Note: Serial signing demands that cmsFormat "PKCS7_ISO320001" and ocspFormat OCSP_RFC6960_COMPATIBLE" is set in infoitems
sessioncontext | This is the context handle for the current merchant |
enckey | The encryption key |
encdata | The encrypted request |
encauth | The MAC of the encrypted data |
operation | The operation parameter sent from the BankID Client |
sid | The sid parameter sent from the BankID Client. |
response | The encrypted response |
BIDCSERVER_API int BIDCALLCONV BID_InitTransactionSelfAssembler | ( | const int | sessioncontext, |
const char * | enc_key, | ||
const char * | enc_data, | ||
const char * | enc_auth, | ||
const char * | operation, | ||
const char * | sid, | ||
BID_VisualSealBuilder | merchant_visual_seal_builder, | ||
char ** | response | ||
) |
BID_InitTransactionSelfAssembler is used by the merchant to create the encrypted response to the initSign operation when doing self-assembling serial signing. The method is used for self-assembled serial signed documents only. Note: Serial signing demands that cmsFormat "PKCS7_ISO320001" and ocspFormat OCSP_RFC6960_COMPATIBLE" is set in infoitems Note: The merchant_visual_seal_builder will be called for BID_SERIAL documents only, not for BID_SERIAL_END_USER_ONLY documents.
sessioncontext | This is the context handle for the current merchant |
enckey | The encryption key |
encdata | The encrypted request |
encauth | The MAC of the encrypted data |
operation | The operation parameter sent from the BankID Client |
sid | The sid parameter sent from the BankID Client. |
merchant_visual_seal_builder | The callback to use to add the visual seal to the pdf serial documents, must be null if turnkey solution, a valid function pointer if self assembling merchant |
response | The encrypted response |
BIDCSERVER_API int BIDCALLCONV BID_OpenSession | ( | SESSION_HANDLE * | sessioncontext, |
const char * | keylocation, | ||
const char * | password, | ||
const char * | configlocation, | ||
const char * | webaddress, | ||
const char * | tagcache, | ||
const char * | trustedstore, | ||
const char * | grantedpolicies, | ||
const char * | proxyserver, | ||
const char * | proxyport | ||
) |
BID_OpenSession must be called for every merchant that wants to create a merchantsession towards the library. When BID_OpenSession returns a context is created which must be used in all future calls for services.
sessioncontext | This is a reference to a variable where BankID C Server will store the context for the merchant |
keylocation | This must be the full path to the merchants keystore file. |
password | This is the password for the merchants keystore file. |
configlocation | This must contain the full path to the merchants configuration file, or NULL if not supplied |
webaddress | The web addresses and ip addresses used for MITM. |
tagcache | The full path to where to store cached tags. |
trustedstore | The full path to where the trusted ca certificates are located for ssl communication |
grantedpolicies | List of policyOIDs which are granted to be used with BankID Server. |
proxyserver | The ip address of an http proxy server. |
proxyport | The port of the http proxy server. |
BIDCSERVER_API int BIDCALLCONV BID_PushSms | ( | const SESSION_HANDLE | sessioncontext, |
const char * | transactionreference, | ||
const char * | text | ||
) |
BID_PushSms can be used to send the mobile user an SMS upon receiving a transaction reference from BID_RequestMobileAction
sessioncontext | This is the context handle for the current merchant |
transactionreference | The reference returned after a successfull mobile action |
text | The text to send to the mobile user |
BIDCSERVER_API int BIDCALLCONV BID_RAHSMOpenSession | ( | SESSION_HANDLE * | sessioncontext, |
const char * | keylocation, | ||
const char * | password, | ||
const char * | pkcs11password, | ||
const int | slot | ||
) |
BID_RAHSMOpenSession must be called for every bank that wants to create an RA session towards the library where their private keys are stored in an HSM. BID_RAHSMOpenSession is called for banks who need to run BankID Server in RA mode. RA mode means that the server is used to sign and build a dsig xml which is further sent to the ODS system. When BID_RAHSMOpenSession returns, a context is created which must be used in all future calls for services.
sessioncontext | This is a reference to a variable where BankID C Server will store the context for the merchant |
keylocation | This must be the full path to the merchants keystore file. |
password | This is the password for the merchants keystore file. |
pkcs11password | The password of the HSM where the keys reside |
slot | The slot in the hsm to use. |
BIDCSERVER_API int BIDCALLCONV BID_RemoveCRLF | ( | const SESSION_HANDLE | sessioncontext, |
const char * | in, | ||
char ** | out | ||
) |
BID_RemoveCRLF is basically a utility method for removing "\r" and "\n" characters in the incoming string.
sessioncontext | This is the context handle for the current merchant |
in | This is the incoming string to strip for "\r" and "\n" characters. |
out | This is a reference to a pointer where BankID C Server will allocate memory and fill the incoming string stripped for "\r" and "\n" |
BIDCSERVER_API int BIDCALLCONV BID_RemoveInfoItems | ( | const SESSION_HANDLE | sessioncontext | ) |
BID_RemoveInfoItems will clear all stored key/value parameters for the merchant session.
sessioncontext | This is the context handle for the current merchant |
BIDCSERVER_API int BIDCALLCONV BID_RequestMobileAction | ( | const SESSION_HANDLE | sessioncontext, |
char ** | transactionreference | ||
) |
BID_RequestMobileAction is used by the merchant to perform a BankID operation using the mobile phone of the user. The parameteres must be set in the merchants session prior to calling this method by using BID_SetInfoItem(). These parameters include the action, the URL for the communication, the phone number and other parameters.
sessioncontext | This is the context handle for the current merchant |
transactionreference | This is a transaction reference for the performed operation. This can later be used for sending the user an SMS using BID_PushSms |
BIDCSERVER_API int BIDCALLCONV BID_RequestMobileStatus | ( | const SESSION_HANDLE | sessioncontext, |
const char * | transactionreference, | ||
char ** | transactionstatus | ||
) |
BID_RequestMobileStatus retrieves the status from an earlier initialized BID_RequestMobileAction.
sessioncontext | This is the context handle for the current merchant |
transactionreference | The reference returned after a successfull mobile action |
transactionstatus | The reference status returned after a successfull mobile action |
BIDCSERVER_API int BIDCALLCONV BID_SDOAddData | ( | const SESSION_HANDLE | sessioncontext, |
BID_SEIDSDO * | sdo, | ||
const char * | data | ||
) |
BID_SDOAddData adds a contract to the SDO.
sessioncontext | This is the context handle for the current merchant. |
sdo | This is the SDO that should contain the contract. |
data | The contract to add base64 encoded. |
BIDCSERVER_API int BIDCALLCONV BID_SDOAddSignature | ( | const SESSION_HANDLE | sessioncontext, |
BID_SEIDSDO * | sdo, | ||
const BID_Signature * | signatures, | ||
const char * | data | ||
) |
BID_SDOAddSignature adds signatures to an existing SDO
sessioncontext | This is the context handle for the current merchant. |
sdo | This is the SDO that should contain the contract. |
signatures | All signatures that sould be put into the SDO. |
data | The contract that is signed. |
BIDCSERVER_API int BIDCALLCONV BID_SDOFree | ( | const SESSION_HANDLE | sessioncontext, |
BID_SEIDSDO * | sdo | ||
) |
BID_SDOFree frees all memory absorbed by the SEIDSDO structure.
sessioncontext | This is the context handle for the current merchant |
sdo | This is the constructed SEIDSDO structure. |
BIDCSERVER_API int BIDCALLCONV BID_SDOSeal | ( | const SESSION_HANDLE | sessioncontext, |
BID_SEIDSDO * | sdo, | ||
const char * | ocsp, | ||
const char * | data | ||
) |
BID_SDOSeal seals an SDO.
sessioncontext | This is the context handle for the current merchant. |
sdo | This is the SDO to be sealed |
ocsp | A newly created OCSP response for the merchant itself |
data | The contract that has been signed in the SDO |
BIDCSERVER_API int BIDCALLCONV BID_SDOToXMLEx | ( | const SESSION_HANDLE | sessioncontext, |
const BID_SEIDSDO * | sdo, | ||
char ** | sdoxml | ||
) |
BID_SDOToXMLEx will take an SDO structure and create an XML string of it. The XML string can afterwards be saved as a regular textfile. The output is encoded as UTF-8.
sessioncontext | This is the context handle for the current merchant |
sdo | This is the constructed SDO structure. |
sdoxml | This is a reference to a pointer where BankID C Server will allocate memory and fill in the SDO XML. |
BIDCSERVER_API int BIDCALLCONV BID_SDOValidate | ( | const SESSION_HANDLE | sessioncontext, |
const BID_SEIDSDO * | sdo, | ||
const int | verifydata | ||
) |
BID_SDOValidate will validate an SDO.
sessioncontext | This is the context handle for the current merchant |
sdo | This is the constructed SDO structure. |
verifydata | If ==0, the data in the SDO will not be verified. If <>0, the data (BID_SDOAddData() must previously have been called) will be verified. |
BIDCSERVER_API int BIDCALLCONV BID_SDOXMLExtractSignatures | ( | const int | sessioncontext, |
const char * | sdoxml, | ||
char ** | data, | ||
char ** | datatype, | ||
char ** | datadescription, | ||
BID_Signature ** | signatures | ||
) |
BID_SDOXMLExtractSignatures is used by the merchant to extract all relevant data for sdo xml structures created by earlier versions of BankID Server.
sessioncontext | This is the context handle for the current merchant |
sdoxml | The SDO XML |
data | The data in the sdo will be put here |
datatype | The datatype in the sdo will be put here |
datadescription | The datadescription in the sdo will be put here |
signatures | The signatures in the sdo will be put here |
BIDCSERVER_API int BIDCALLCONV BID_SDOXMLValidate | ( | const SESSION_HANDLE | sessioncontext, |
const char * | sdo, | ||
const int | verifydata | ||
) |
BID_SDOXMLValidate will validate an SDO. If the data itself should be verified the verifydata flag must be set.
sessioncontext | This is the context handle for the current merchant |
sdo | This is the constructed SDO structure. |
verifydata | If ==0, the data in the SDO will not be verified. If <>0, the data (BID_SDOAddData() must previously have been called) will be verified. |
BIDCSERVER_API int BIDCALLCONV BID_SetInfoItem | ( | const SESSION_HANDLE | sessioncontext, |
const char * | key, | ||
const char * | value | ||
) |
BID_SetInfoItem is used by the merchant to store key/value pairs in its own session. The key/value pairs will reside in the merchants session until the merchant itself calls BID_RemoveInfoItems().
sessioncontext | This is the context handle for the current merchant |
key | This is the key to use for the value parameter. |
value | This is the value to store under the corresponding key. |
BIDCSERVER_API int BIDCALLCONV BID_SetSerialSignedData | ( | const int | sessioncontext, |
const BID_SerialSigningData * | serial_signing_data | ||
) |
BID_SetSignedData is used to set the data that was signed before a call to BID_VerifyTransactionRequest. Note: The data is copied from the parameters, so freeing data and serial_signing_data is your responsibility. Note: use BID_FreeSerialSigningData for serial_signing_data.
sessioncontext | This is the context handle for the current merchant |
serial_signing_data | The serial_signing_data (obtained with BID_GetSerialSignedData after a successful call to BID_InitTransaction, BID_InitSignSignMerchantSeal, BID_InitSignBuildEndUserSeal) |
BIDCSERVER_API int BIDCALLCONV BID_SetSignedData | ( | const int | sessioncontext, |
const char * | data | ||
) |
BID_SetSignedData is used to set the data that was signed before a call to BID_VerifyTransactionRequest
sessioncontext | This is the context handle for the current merchant |
data | The signed data (obtained with BID_GetSignedData after a successful call to BID_InitTransaction) |
BIDCSERVER_API int BID_SignaturesFree | ( | const SESSION_HANDLE | sessioncontext, |
BID_Signature * | signature | ||
) |
BID_SignaturesFree frees all memory allocated by a BID_Signature structure.
sessioncontext | This is the context handle to be used. |
signature | This is the BID_Signature structure to free |
BIDCSERVER_API int BIDCALLCONV BID_SignData | ( | const SESSION_HANDLE | sessioncontext, |
const unsigned char * | data, | ||
const size_t | datalen, | ||
char ** | pkcs7 | ||
) |
BID_SignData creates a PKCS#7 signature on behalf of the merchant.
sessioncontext | This is the context handle for the current merchant |
data | The data to be signed. This can be a usual text or just raw bytes. |
datalen | The length of the data to be signed |
pkcs7 | This is a reference to a pointer where BankID C Server will allloate memory and store the PKCS#7 structure in BASE64 format. |
BIDCSERVER_API int BIDCALLCONV BID_SignDataP1 | ( | const SESSION_HANDLE | sessioncontext, |
const unsigned char * | data, | ||
const size_t | datalen, | ||
char ** | pkcs1 | ||
) |
BID_SignData creates a PKCS#1 signature on behalf of the merchant.
sessioncontext | This is the context handle for the current merchant |
data | The data to be signed. This can be a usual text or just raw bytes. |
datalen | The length of the data to be signed |
pkcs1 | This is a reference to a pointer where BankID C Server will allloate memory and store the PKCS#1 structure in BASE64 format. |
BIDCSERVER_API int BIDCALLCONV BID_SignXML | ( | const int | sessioncontext, |
const unsigned char * | xml, | ||
const size_t | xmllen, | ||
const unsigned char * | xsl, | ||
const size_t | xsllen, | ||
char ** | pkcs7, | ||
char ** | data | ||
) |
BID_SignXML creates a PKCS#7 signature over an XSL stylesheet and an XML
sessioncontext | This is the context handle for the current merchant |
xml | The xml that should be signed. |
xmllen | The length of the xml that should be signed. |
xsl | The xml that should be signed. |
xsllen | The length of the xsl that should be signed. |
pkcs7 | This is a reference to a pointer where BankID C Server will allloate memory and store the PKCS#7 structure in BASE64 format. |
data | This is a reference to a pointer where BankID C Server will allloate memory and store the the data that was actually signed. |
BIDCSERVER_API int BIDCALLCONV BID_SimpleDynamicSDOXMLValidate | ( | const SESSION_HANDLE | sessioncontext, |
const char * | sdo, | ||
const int | minnumsignatures | ||
) |
BID_SimpleDynamicSDOXMLValidate will do a simple validation of a dynamic SDO. It only checks that the dynamic SDO is sealed and contains at least n signatures.
sessioncontext | This is the context handle for the current merchant |
sdo | This is the SDO XML that should contain the singatures. |
minnumsignatures | The minimum number of signatures expected in the SDO. |
BIDCSERVER_API int BIDCALLCONV BID_VerifyData | ( | const SESSION_HANDLE | sessioncontext, |
const char * | pkcs7, | ||
const unsigned char * | data, | ||
const size_t | datalen | ||
) |
BID_VerifyData verifies a PKCS#7 structure against incoming data.
sessioncontext | This is the context handle for the current merchant |
pkcs7 | This is a BASE64 encoded PKCS#7 structure to verify. |
data | The data that apparently is signed when the PKCS#7 signature was created |
datalen | The length of the data that apparently is signed when the PKCS#7 signature was created |
BIDCSERVER_API int BIDCALLCONV BID_VerifySignAddDSS | ( | const int | sessioncontext, |
const char * | enckey, | ||
const char * | encdata, | ||
const char * | encauth, | ||
const char * | operation, | ||
const char * | sid, | ||
char ** | response | ||
) |
BID_VerifySignAddDSS is used by the merchant in turn key flow for adding clientproxy packed validation data to the PDFs The method is used for serial signed documents, will be called at most once pr. session. Should be called by merchant when operation equals "verifySignAddDSS" Note: Serial signing demands that cmsFormat "PKCS7_ISO320001" and ocspFormat OCSP_RFC6960_COMPATIBLE" is set in infoitems
sessioncontext | This is the context handle for the current merchant |
enckey | The encryption key |
encdata | The encrypted request |
encauth | The MAC of the encrypted data |
operation | The operation parameter sent from the BankID Client |
sid | The sid parameter sent from the BankID Client. |
response | The encrypted response |
BIDCSERVER_API int BIDCALLCONV BID_VerifyTransactionRequest | ( | const int | sessioncontext, |
const char * | enckey, | ||
const char * | encdata, | ||
const char * | encauth, | ||
const char * | operation, | ||
const char * | sid | ||
) |
BID_VerifyTransactionRequest is used by the merchant to handle the verifyAuth/verifySign/handleError operation from the encrypted request of the BankID client.
If the operation is 'handleError', BID_VerifyTransactionRequestSelfAssembler and BID_VerifyTransactionRequest are interchangable.
In addition to the encrypted request, some infoitems must be set prior to calling this method using BID_SetInfoItem(). Some infoitems will also be available using BID_GetInfoItem() after calling this method. See the the BankID C Server Interface Specification for the details.
Note: Serial signing demands that cmsFormat "PKCS7_ISO320001" and ocspFormat OCSP_RFC6960_COMPATIBLE" is set in infoitems
sessioncontext | This is the context handle for the current merchant |
enckey | The encryption key |
encdata | The encrypted request |
encauth | The MAC of the encrypted data |
operation | The operation parameter sent from the BankID Client |
sid | The sid parameter sent from the BankID Client. |
BIDCSERVER_API int BIDCALLCONV BID_VerifyTransactionRequestSelfAssembler | ( | const int | sessioncontext, |
const char * | enckey, | ||
const char * | encdata, | ||
const char * | encauth, | ||
const char * | operation, | ||
const char * | sid, | ||
BID_ValidationBuilder | validation_increment_builder | ||
) |
BID_VerifyTransactionRequestSelfAssembler is used by the merchant to handle the verifySign/handleError operation from the encrypted request of the BankID client when doing self-assembled serial signing.
If the operation is 'handleError', BID_VerifyTransactionRequestSelfAssembler and BID_VerifyTransactionRequest are interchangable.
In addition to the encrypted request, some infoitems must be set prior to calling this method using BID_SetInfoItem(). Some infoitems will also be available using BID_GetInfoItem() after calling this method. See the the BankID C Server Interface Specification for the details.
Note: Serial signing demands that cmsFormat "PKCS7_ISO320001" and ocspFormat OCSP_RFC6960_COMPATIBLE" is set in infoitems.
sessioncontext | This is the context handle for the current merchant |
enckey | The encryption key |
encdata | The encrypted request |
encauth | The MAC of the encrypted data |
operation | The operation parameter sent from the BankID Client |
sid | The sid parameter sent from the BankID Client. |
validation_increment_builder | null for turnkey validation building, valid function pointer for selfassembler. |
BIDCSERVER_API int BIDCALLCONV BID_VerifyTransactionResponse | ( | const int | sessioncontext, |
char ** | response | ||
) |
BID_VerifyTransactionResponse is used by the merchant to create the encrypted response for the verifyAuth/verifySign/handleError operation or sending an error message should an error occur. Some infoitems must be set prior to calling this method using BID_SetInfoItem(). See the the BankID C Server Interface Specification for the details.
sessioncontext | This is the context handle for the current merchant |
response | The encrypted response |
BIDCSERVER_API int BIDCALLCONV BID_XMLToSDOEx | ( | const SESSION_HANDLE | sessioncontext, |
const char * | sdoxml, | ||
BID_SEIDSDO ** | sdo | ||
) |
BID_XMLToSDOEx takes an SDO XML previosly created by BID_SDOToXML() and parses it into an SDO structure. The sdoxml must be valid UTF-8 encoded text.
sessioncontext | This is the context handle for the current merchant |
sdoxml | This is the xml representation of an SDO. |
sdo | This is the reference to the pointer that BankID C Server will fill with an SDO struct. |