on 12-19-2005 1:12 PM
Hi,
(I'm not shure if this is the correct forum, please send me a note if I'm wrong here.)
I try to implement a HTTP Content Server for SAP ArchiveLink, but I have troubles with the url signature. I try to use the sapsecu.dll to verify the PKCS#7 signature, but I fail even with the provided example from SAP.
This is my test code to decode the signature (originally passed via base64) but I always receive the errorcode 12, meaning "wrong format".
// SapSecuWrapper.h
#include <string.h>
#include "AMMimeUtils.h"
#include "ssfxxapi.h"
#pragma once
using namespace System;
namespace SapSecuWrapper {
public ref class SapSecuWrapper
{
public:
static int test(void)
{
int b;
char* base64 = "MIIBlgYJKoZIhvcNAQcCoIIBhzCCAYMCAQExCzAJBgUrDgMCGgU
AMAsGCSqGSIb3DQEHATGCAWIwggFeAgEBMBMwDjEMMAoGA1UEAxM
DSUQzAgEAMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZ
IhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0wMDA1MDUxNDA2NTFaMCM
GCSqGSIb3DQEJBDEWBBQGYof+huv7Gw7r+UmGzIai+1i3DTCBpwY
FKw4DAhswgZ0CQQEkJRHP+mN7d8miwTMN55CUSmo3TO8WGCxgY61
TX5k+7NU4XPf1TULjw3GobwaJX13kquPhfVXk+gVy46n4Iw3hAhU
BSe/QF4BUj+pJOF9ROBM4u+FEWA8CQQD4mSJbrABjTUWrlnAte8p
S22Tq4/FPO7jHSqjijUHfXKTrHL1OEqV3SVWcFy5j/cqBgX/zm8Q
12PFp/PjOhh+nBDAwLgIVAJw5q7oYYDAKplAXqFjOuLTC53daAhU
A1GTCFCLfwwgJWul7yfVYfwc84jk=";
secKeyStr;
CBase64Utils* cqp = new CBase64Utils();
char* secKeyStr = cqp->Decode(base64, &b);
SsfOctetstring* a = new SsfOctetstring;
int len = strlen(secKeyStr);
int r = SsfDecode("PKCS7", 5, secKeyStr, len, a, &b);
delete secKeyStr;
delete a;
return r;
}
};
}
Originally I used a .NET code, but to rule out marshalling problems I moved to C++. I first tried the .NET 2.0 functions but I faced problems there as well.
Can anyone help me, or tell my that I'm on the wrong way?
Thank you in advance,
Christoph
No Ideas? I really welcome comments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.