API C/C++
HSM Dinamo
Loading...
Looking for...
No entries found
sign_check_pix_jws.c

Example JWS signature and validation in the PIX standard defined in the SPI (Instant Payment System).

See Note on examples.
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <dinamo.h> /* header do Dinamo */
#define HOST_ADDR "127.0.0.1"
#define USER_ID "master"
#define USER_PWD "12345678"
int ImportTestKey(HSESSIONCTX hSession, const char *szKeyId, const char *szCertId,
const char *szPubKeyId, const char *szChainId)
{
unsigned char pbPkcs12[2293] =
{
0x30, 0x82, 0x08, 0xF1, 0x02, 0x01, 0x03, 0x30, 0x82, 0x08, 0xB7, 0x06, 0x09, 0x2A, 0x86, 0x48,
0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x82, 0x08, 0xA8, 0x04, 0x82, 0x08, 0xA4, 0x30, 0x82,
0x08, 0xA0, 0x30, 0x82, 0x03, 0x57, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07,
0x06, 0xA0, 0x82, 0x03, 0x48, 0x30, 0x82, 0x03, 0x44, 0x02, 0x01, 0x00, 0x30, 0x82, 0x03, 0x3D,
0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0x30, 0x1C, 0x06, 0x0A, 0x2A,
0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x0C, 0x01, 0x06, 0x30, 0x0E, 0x04, 0x08, 0x27, 0x31, 0x3C,
0x53, 0x2E, 0x6C, 0xDE, 0x90, 0x02, 0x02, 0x08, 0x00, 0x80, 0x82, 0x03, 0x10, 0x6F, 0xFD, 0xE3,
0xB3, 0xEB, 0xA7, 0x4F, 0xCF, 0x57, 0x18, 0x8A, 0x0F, 0x63, 0xE5, 0xE4, 0x57, 0x0B, 0x65, 0xCE,
0xE0, 0xDF, 0x3D, 0x0E, 0x3E, 0x1B, 0xC0, 0xEC, 0x7C, 0xB9, 0x3D, 0xBF, 0x8A, 0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0xB5, 0x46, 0xBC, 0x1D, 0x4E, 0x17, 0x98, 0xE2, 0xE0, 0x52, 0x5D, 0x8F, 0xB9, 0x1B, 0xF5,
0x4B, 0x05, 0x1D, 0x63, 0xD8, 0x28, 0xDB, 0x80, 0x09, 0x1B, 0x10, 0x6E, 0x5E, 0x4A, 0x8B, 0x5D,
0xAE, 0x8B, 0xA4, 0xBF, 0x0F, 0x01, 0xEB, 0xB3, 0x22, 0x79, 0xFB, 0x31, 0x25, 0x30, 0x23, 0x06,
0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x15, 0x31, 0x16, 0x04, 0x14, 0x2E, 0x28,
0xC1, 0x0E, 0x97, 0xD3, 0x71, 0xE2, 0x6A, 0xF3, 0x94, 0xEF, 0x99, 0xEB, 0x5F, 0x50, 0x98, 0x1B,
0xDA, 0xFE, 0x30, 0x31, 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A, 0x05,
0x00, 0x04, 0x14, 0x40, 0x4B, 0xBE, 0xBD, 0x5C, 0x5F, 0x59, 0x41, 0xFD, 0xC8, 0x68, 0x28, 0xF9,
0x85, 0x2B, 0x7E, 0xEE, 0x1C, 0x67, 0x13, 0x04, 0x08, 0x64, 0x37, 0xC6, 0xCB, 0x26, 0x50, 0x8F,
0x79, 0x02, 0x02, 0x08, 0x00};
unsigned char pbPkcs7Chain[1495] =
{
0x30, 0x82, 0x05, 0xD3, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x02, 0xA0,
0x82, 0x05, 0xC4, 0x30, 0x82, 0x05, 0xC0, 0x02, 0x01, 0x01, 0x31, 0x00, 0x30, 0x0B, 0x06, 0x09,
0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x07, 0x01, 0xA0, 0x82, 0x05, 0xA8, 0x30, 0x82, 0x02,
0xB0, 0x30, 0x82, 0x01, 0x98, 0x02, 0x14, 0x49, 0x6D, 0x71, 0xA9, 0xEB, 0xCF, 0x6E, 0xCE, 0xB0,
0x15, 0x0E, 0xA5, 0x59, 0x19, 0xF3, 0x19, 0x9F, 0x38, 0x15, 0x79, 0x30, 0x0D, 0x06, 0x09, 0x2A,
0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x11, 0x31, 0x0F, 0x30, 0x0D,
0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x06, 0x43, 0x53, 0x50, 0x42, 0x2D, 0x31, 0x30, 0x1E, 0x17,
0x0D, 0x32, 0x30, 0x30, 0x31, 0x32, 0x39, 0x31, 0x38, 0x33, 0x30, 0x35, 0x34, 0x5A, 0x17, 0x0D,
0x33, 0x39, 0x31, 0x30, 0x31, 0x36, 0x31, 0x38, 0x33, 0x30, 0x35, 0x34, 0x5A, 0x30, 0x18, 0x31,
0x16, 0x30, 0x14, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x0D, 0x49, 0x53, 0x50, 0x42, 0x2D, 0x31,
0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A,
0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F, 0x00, 0x30,
0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xCB, 0xD7, 0x9A, 0x43, 0x59, 0xD1, 0x22, 0xA3,
0xD0, 0xFB, 0x63, 0x1C, 0x40, 0xC4, 0xEE, 0x68, 0x23, 0xB5, 0x72, 0x95, 0xAE, 0x51, 0x5D, 0x00,
0x07, 0x33, 0x29, 0x58, 0x85, 0x63, 0x11, 0xB9, 0x32, 0x93, 0x0F, 0x73, 0xC6, 0xB2, 0xAB, 0x35,
0xF8, 0x17, 0x53, 0x53, 0xD7, 0xA3, 0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0x34, 0x30, 0x37, 0x5A, 0x17, 0x0D, 0x33, 0x39, 0x31, 0x30, 0x31, 0x36, 0x31,
0x38, 0x32, 0x34, 0x30, 0x37, 0x5A, 0x30, 0x11, 0x31, 0x0F, 0x30, 0x0D, 0x06, 0x03, 0x55, 0x04,
0x0B, 0x0C, 0x06, 0x43, 0x53, 0x50, 0x42, 0x2D, 0x31, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D, 0x06,
0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F,
0x00, 0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xD6, 0x00, 0x91, 0xE6, 0x56, 0xDA,
0x73, 0xBB, 0x8F, 0x63, 0x21, 0xE0, 0xED, 0xAD, 0xE5, 0xF7, 0x55, 0xDD, 0x19, 0x12, 0x58, 0x92,
0x89, 0x29, 0x2A, 0x12, 0x13, 0x10, 0x2C, 0x30, 0x7B, 0xC2, 0x04, 0xCA, 0xBB, 0xEB, 0xCC, 0xD4,
0xE1, 0x07, 0x9D, 0x96, 0x40, 0x8E, 0xCE, 0xF9, 0xD6, 0xD9, 0xD5, 0x13, 0x97, 0x00, 0x67, 0x94,
0xFB, 0x41, 0xA5, 0x9F, 0xA0, 0xBD, 0x20, 0xB8, 0x04, 0x3F, 0xE1, 0x4D, 0xB6, 0x50, 0x6B, 0x35,
0x2C, 0x30, 0x76, 0xEE, 0xB4, 0xC6, 0x1B, 0x85, 0xDF, 0xC5, 0xFE, 0x13, 0xAE, 0x12, 0x80, 0x62,
0xDD, 0x59, 0xA4, 0x3A, 0x8B, 0x2D, 0x9B, 0x59, 0x41, 0xF7, 0x02, 0x02, 0xB3, 0x57, 0x06, 0xF8,
0x00, 0x63, 0x0E, 0x5D, 0x94, 0x66, 0xB8, 0xC7, 0x72, 0x1D, 0xC0, 0xC5, 0x44, 0xC6, 0xB5, 0x67,
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 0xC6, 0x0A, 0x51, 0x12, 0x70, 0xA3, 0x69, 0x5F, 0x07, 0xB0, 0xA4, 0xC5, 0x54, 0xF5, 0xA2,
0x3D, 0xAD, 0x01, 0x16, 0x0D, 0x3E, 0x28, 0xEF, 0xC0, 0x28, 0x18, 0x6A, 0x83, 0x8E, 0xE6, 0x93,
0x0C, 0xFB, 0x8D, 0xBF, 0xB0, 0x83, 0xD8, 0x39, 0x43, 0xC6, 0x8B, 0x80, 0xFA, 0x1F, 0xDA, 0x54,
0xF4, 0xEB, 0x9D, 0xEE, 0x2B, 0x2E, 0x33, 0x48, 0x9C, 0x74, 0xA1, 0x27, 0xD1, 0xD2, 0x35, 0x6A,
0xCF, 0x72, 0xA7, 0x5B, 0xA9, 0xF3, 0xAC, 0x51, 0x89, 0x61, 0xFD, 0x7E, 0xD9, 0xD5, 0x65, 0xA8,
0xC8, 0x3D, 0xC8, 0x43, 0xDB, 0x1D, 0x90, 0x45, 0x78, 0xE7, 0xCC, 0xF5, 0x77, 0xFC, 0x56, 0xE8,
0x34, 0x6B, 0xC3, 0xD7, 0x34, 0xFE, 0x41, 0xCD, 0xFD, 0x53, 0x75, 0xC2, 0x19, 0x4C, 0x0E, 0xCE,
0x5A, 0xB0, 0x95, 0x2B, 0x88, 0x9F, 0xA0, 0xFA, 0x0F, 0xC6, 0x2B, 0x4B, 0x6E, 0x77, 0x18, 0x81,
0x27, 0x13, 0x3B, 0x7C, 0x7B, 0x31, 0x00};
int nRet = 0;
const char *szPkcs12Pwd = "12345678";
nRet = DImportPKCS12Buffer(hSession, pbPkcs12, sizeof(pbPkcs12), szPkcs12Pwd,
szKeyId, EXPORTABLE_KEY, szCertId, szPubKeyId, 0);
if (nRet)
{
printf("Falha na funcao: DImportPKCS12Buffer \nCodigo de erro: %d\n", nRet);
return nRet;
}
if (szChainId == NULL)
return 0;
nRet = DWriteFileBuffer(hSession, szChainId, pbPkcs7Chain, sizeof(pbPkcs7Chain), 0);
if (nRet)
{
printf("Falha na funcao: DWriteFileBuffer \nCodigo de erro: %d\n", nRet);
return nRet;
}
return 0;
}
int main()
{
int nRet = 0;
struct AUTH_PWD authPwd;
HSESSIONCTX hSession = NULL;
char szKeyId[] = "jws_key";
char szCertId[] = "jws_key_cert";
char szChainId[] = "jws_key_chain";
BYTE pbHeader[] = {123, 34, 97, 108, 103, 34, 58, 34, 82, 83, 50, 53, 54, 34, 125};
BYTE pbPayload[] = {123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10,
32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56,
48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97,
109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111,
111, 116, 34, 58, 116, 114, 117, 101, 125};
//Inicializa as bibliotecas do Dinamo
nRet = DInitialize(0);
if (nRet) {
printf("Falha na funcao: DInitialize \nCodigo de erro: %d\n", nRet);
goto clean;
}
printf("Bibliotecas inicializadas.\n");
//Inicializa a estrutura para conexão com o HSM
strncpy(authPwd.szAddr, HOST_ADDR, sizeof(authPwd.szAddr));
authPwd.nPort = DEFAULT_PORT;
strncpy(authPwd.szUserId, USER_ID, sizeof(authPwd.szUserId));
strncpy(authPwd.szPassword, USER_PWD, sizeof(authPwd.szPassword));
nRet = DOpenSession(&hSession, SS_USER_PWD, (BYTE *)&authPwd, sizeof(authPwd), ENCRYPTED_CONN);
if (nRet) {
printf("Falha na funcao: DOpenSession \nCodigo de erro: %d\n", nRet);
goto clean;
}
printf("Sessao com o Dinamo estabelecida.\n");
nRet = ImportTestKey(hSession, szKeyId, szCertId, NULL, szChainId);
if (nRet)
{
printf("Falha na funcao: ImportTestKey \nCodigo de erro: %d\n", nRet);
goto clean;
}
printf("Chaves e certificados de teste importados com sucesso.\n");
BYTE pbJws[PIX_JWS_GEN_MAX_LEN] = { 0 };
DWORD dwJwsLen = sizeof(pbJws);
nRet = DPIXJWSSign( hSession,
szKeyId,
0,
sizeof(pbHeader),
pbHeader,
sizeof(pbPayload),
pbPayload,
&dwJwsLen,
pbJws);
if (nRet) {
printf("Falha na funcao: DPIXJWSSign \nCodigo de erro: %d\n", nRet);
goto clean;
}
printf("JWS assinado com sucesso\n");
BYTE pbOutHeader[PIX_JWS_GEN_MAX_LEN] = { 0 };
DWORD dwOutHeaderLen = sizeof(pbOutHeader);
BYTE pbOutPayload[PIX_JWS_GEN_MAX_LEN] = { 0 };
DWORD dwOutPayloadLen = sizeof(pbOutPayload);
nRet = DPIXJWSCheck(hSession,
szChainId,
NULL,
dwJwsLen,
pbJws,
0,
&dwOutHeaderLen,
pbOutHeader,
&dwOutPayloadLen,
pbOutPayload);
if (nRet) {
printf("Falha na funcao: DPIXJWSCheck \nCodigo de erro: %d\n", nRet);
goto clean;
}
printf("Assinatura verificada com sucesso\n");
clean:
if (hSession) {
DCloseSession(&hSession, 0);
printf("Sessao encerrada.\n");
}
printf("Bibliotecas finalizada.\n");
return nRet;
}
Application Programming Interface (API) do HSM Dinamo.
void * HSESSIONCTX
Definição dinamo.h:68
#define DEFAULT_PORT
Definição dinamo.h:1949
unsigned char BYTE
Definição dinamo.h:45
#define PIX_JWS_GEN_MAX_LEN
Definição dinamo.h:972
unsigned int DWORD
Definição dinamo.h:46
#define ENCRYPTED_CONN
Definição dinamo.h:585
#define SS_USER_PWD
Definição dinamo.h:576
#define EXPORTABLE_KEY
Definição dinamo.h:1423
int AAP_API DImportPKCS12Buffer(const HSESSIONCTX hSession, BYTE *pbPkcs12, DWORD dwPkcs12Len, const char *szPkcs12Pwd, const char *szKeyId, DWORD dwKeyAttr, const char *szCertId, const char *szPubKeyId, DWORD dwFlags)
int AAP_API DWriteFileBuffer(HSESSIONCTX hSession, const char *szFileId, BYTE *pbFile, DWORD dwFileSize, DWORD dwOptions)
int AAP_API DPIXJWSCheck(HSESSIONCTX hSession, const char *szChain, const char *szCRL, DWORD dwJWSLen, BYTE *pbJWS, DWORD dwFlags, DWORD *pdwHeaderLen, BYTE *pbHeader, DWORD *pdwPayloadLen, BYTE *pbPayload)
int AAP_API DPIXJWSSign(HSESSIONCTX hSession, const char *szKeyId, DWORD dwFlags, DWORD dwHeaderLen, BYTE *pbHeader, DWORD dwPayloadLen, BYTE *pbPayload, DWORD *pdwJWSLen, BYTE *pbJWS)
int AAP_API DOpenSession(HSESSIONCTX *phSession, DWORD dwParam, BYTE *pbData, DWORD dwDataLen, DWORD dwFlags)
int AAP_API DCloseSession(HSESSIONCTX *phSession, DWORD dwFlags)
int AAP_API DInitialize(DWORD dwReserved)
int AAP_API DFinalize()
Definição dinamo.h:3090